Results 1 to 8 of 8

Thread: Firefox-like tabs

  1. #1
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Firefox-like tabs

    I'm trying to build Firefox/Mac OS X-type tabs: Basically, icons along the top of the window with textual labels.

    I used the ConfigDialog example as a starting point. I was unable to find a way to have the icons run across instead of up and down. I changed to a QTableWidget, and was able to get this working. However, I have not been able to figure out how to make the icon in a cell appear above the cell's text instead of to the left of it. I don't want to use two rows because I'm concerned I won't be able to maintain the illusion that only one cell is selected.

    Is QTableWidget the right approach?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Firefox-like tabs

    How about using QTabWidget (or QTabBar) instead?

  3. #3
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Firefox-like tabs

    I don't think I can hide the tabs and just leave the icon and title bare using Qt's tab controls. I want the icon bar look rather than a tab look. Is that possible? It would sure be a lot less work!

  4. #4
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Thanks
    7
    Thanked 25 Times in 24 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Firefox-like tabs

    Hi,
    what is different in Firefox tabs?
    I made tab bar with close button using QTabWidget.
    if you think that code will help you then I can send you that code.

    Thanks & Regards
    Rajesh

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Firefox-like tabs

    Are we talking about the tabs that are present in firefox which you add by using "Ctrl+T" shortcut? Or maybe you mean some other tabs which we're not aware of... What do you mean by "icon bar look"? A QToolBar maybe?

  6. #6
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Firefox-like tabs

    You're right, I'm not explaining myself properly. I forgot about Firefox's tabbed browsing! Stupid, because I use that all the time. Although come to think of it, I think Firefox might do different things on different platforms...

    This is what I was talking about:
    http://indiehig.com/wiki/Image:Finder_prefs.png

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Firefox-like tabs

    The simplest way is to go for QToolBar or a QButtonGroup.

    The latter in its basic form will look like in the attachment.
    Attached Images Attached Images

  8. #8
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Firefox-like tabs

    It took me until today to be sure, but it looks like a QToolbar tied to a QActionGroup will do almost exactly what I need.

Similar Threads

  1. Replies: 2
    Last Post: 23rd July 2012, 09:42
  2. QTabWidget with same tabs
    By Djony in forum Qt Programming
    Replies: 20
    Last Post: 24th December 2011, 13:20
  3. Switching off all tabs in QTabWidget
    By Gopala Krishna in forum Qt Programming
    Replies: 7
    Last Post: 30th August 2006, 18:10
  4. Dynamically adding tabs
    By larry104 in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2006, 21:27
  5. Removing Tabs
    By NewGuy in forum Qt Programming
    Replies: 6
    Last Post: 22nd July 2006, 23:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.