Results 1 to 3 of 3

Thread: QTabWidget tab subcontrol position with qss

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

    Default QTabWidget tab subcontrol position with qss

    I want to put tab-bar at the bottom of the qtabwidget, and I'm trying to do it with this code:

    Qt Code:
    1. QTabWidget::tab-bar {
    2. position: absolute;
    3. subcontrol-origin: margin;
    4. subcontrol-position: center bottom;
    5. }
    To copy to clipboard, switch view to plain text mode 

    but it won't work.
    Where is the error?

    P.S: I know that this is possible to be done with .setTabPosition, but I want to do it with qss

  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 tab subcontrol position with qss

    According to: http://doc.qt.nokia.com/4.6/stylesheet-reference.html

    Qt Code:
    1. Warning:
    2.  
    3. To change the position of the QTabBar within a QTabWidget, use the tab-bar subcontrol (and set subcontrol-position).
    4.  
    5. See Customizing QTabBar for an example.
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. subcontrol-position*
    2.  
    3. The alignment of the subcontrol within the origin rectangle specified by subcontrol-origin.
    4. If this property is not specified, it defaults to a value that depends on the subcontrol.
    5. Example:
    6. QSpinBox::down-button {
    7. image: url(:/images/spindown.png);
    8. subcontrol-origin: padding;
    9. subcontrol-position: right bottom;
    10. }
    To copy to clipboard, switch view to plain text mode 

    Maybe this is a bug?
    Qt Code:
    1. subcontrol-origin*
    2.  
    3. The origin rectangle of the subcontrol within the parent element.
    4. If this property is not specified, the default is padding.
    5. Example:
    6. QSpinBox::up-button {
    7. image: url(:/images/spinup.png);
    8. subcontrol-origin: content;
    9. subcontrol-position: right top;
    10. }
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: QTabWidget tab subcontrol position with qss

    Ok, I found it.

    QTabWidget {
    qproperty-tabPosition: South;
    }

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

Tags for this Thread

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.