Results 1 to 3 of 3

Thread: QTabBar and a QTabWidget-like frame

  1. #1
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTabBar and a QTabWidget-like frame

    Hello.

    I'm new here and though I'm not a complete newbie with Qt I thought it would be better to ask this question in this section.

    How can I make a widget with a QTabBar which is not QTabWidget but looks like it so that there is a bar integrated seamlessly with a frame which doesn't have the upper border?

    This one in the picture has a listwidget below the bar but the bar is just floating there. The listwidget should be inside a frame which uses the bar as the top border but doesn't have its own top border.

  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: QTabBar and a QTabWidget-like frame

    I'm not sure I follow what you mean, but maybe setting the spacing of the layout containing the two widgets to zero will do what you want?

  3. #3
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTabBar and a QTabWidget-like frame

    If I do that the frame still has the upper border and it doesn't look like it's "integrated" with the tab bar. See the picture above and think about having a frame instead of the list widget and moving it up - it doesn't look good.

    I tried to find a solution by looking at QTabWidget source code but it uses quite complicated QStyle and other things for the internal widget stack drawing. I can't follow it.

    My original problem was that I want to use a tab bar for a frame which includes many elements but only one element is really unique for each tab. The other elements remain the same so I don't want to create deep copies of them for each page. The easiest solution was to use a widget stack and tab bar. The tab bar changes the page of the stack, the other elements just remain there.

    Other solution was to use the QTabWidget, but it can't have many pages pointing to one widget. I'm I doomed to creating several widgets which have identical items?

Similar Threads

  1. Hiding the QTabBar of a QTabWidget
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2007, 14:59
  2. QTabWidget, QTabBar, double-click the tabText
    By jcr in forum Qt Programming
    Replies: 3
    Last Post: 21st September 2006, 20:44
  3. Customize QTabBar or QTabWidget
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 08:39

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.