Results 1 to 4 of 4

Thread: QTabWidget / QBarWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Valladolid, Spain
    Posts
    125
    Thanks
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QTabWidget / QBarWidget

    I have a problem with QTabWidget/QTabBar documentMode option.
    If I set that option to True this is what happens:

    http://imagebin.org/108119

    As you can see, I can move the tab from the most-left to the most-right side without any problems. But, there are two bad things. First one is that it screwes my qss style, as you can see in this other image. And the second one is that completely ignores my qss subcontrol styling that will make bars appear in the center.

    http://imagebin.org/108120

    As you can see here, tabs do appear in the center, and my qss is exactly as I want it. But there is a problem. Trying to move the tab to the left or to the right will result in that bug you see in the image (when I tried to move the tab to the left). It gets hidden. If I add tabs, I can move them, and they only dissapear when I try to move them outside of the limits of the rect that holds the tabs.
    Any ideas how could I fix that?
    Thanks!
    Last edited by alexandernst; 4th August 2010 at 21:35.

  2. #2
    Join Date
    Jul 2009
    Location
    Valladolid, Spain
    Posts
    125
    Thanks
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTabWidget / QBarWidget

    After some more hacking, I'm pretty sure that my problem is the qtabbar rect.
    How can I force the qtabbar rect to be always (0, 0, tabwidget.width(), 20) ?
    I tried subclassing qtabwidget and resizeEvent this way:
    Qt Code:
    1. def resizeEvent(self, e):
    2. self.tabBar().setGeometry(self.tabBar().x(), self.tabBar().y(), self.width(), 20)
    To copy to clipboard, switch view to plain text mode 
    but tabbar rect will do weird things when resizing (in fact, it just wont paint itself. It will repaint itself only after resizing has finished.
    Also, tabs won't have the size that I want, but the total size of the rect.

  3. #3
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget / QBarWidget

    Hi,
    is there any answer for the last reply, i have the same problem and i want to use tabbar of a qtabwidget in another position.
    thanks

  4. #4
    Join Date
    Jul 2009
    Location
    Valladolid, Spain
    Posts
    125
    Thanks
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTabWidget / QBarWidget

    I haven't found one, sorry

Similar Threads

  1. QTabWidget
    By Freeman551 in forum Qt Programming
    Replies: 3
    Last Post: 25th December 2009, 00:06
  2. QTabWidget
    By conatic in forum Qt Programming
    Replies: 1
    Last Post: 16th September 2008, 20:05
  3. How do I add new tab to QTabWidget
    By pcmantinker in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2008, 04:24
  4. QTabWidget
    By allstar in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2007, 19:18
  5. QTabWidget tab
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2007, 00:16

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
  •  
Qt is a trademark of The Qt Company.