Results 1 to 4 of 4

Thread: QTabWidget stylesheet

  1. #1
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default QTabWidget stylesheet

    Hi guys!

    I am having a weird minor issue when i use stylesheet on QTabWidget which was not happening in Qt4.3.0 (Currently using Qt4.3.2).

    Lets see the example: http://opencoffee.lnxteam.org/downlo...ver_Client.png

    Look at the main window, the first tab which is named "Información": the first and the last letter does not show correctly on the tab, but it does when i am in positioned in that current tab.
    Now, only happens with the first one, lets say with a more larger word tab, does not happen. Example, with the last tab named "Administración" as you can see.

    This is my stylesheet code:

    css Code:
    1. QTabWidget, QStackedWidget {background: none}
    2. QTabWidget:tab-bar { left: 0.3em;}
    3. QTabWidget:pane {
    4. border: 0px;
    5. top: 0.1em;
    6. border-image: url(:/Styles/styles/tabBg.png);
    7. background-repeat: no repeat;}
    8. QTabBar:tab {
    9. background-image: url(:/Styles/styles/tabBarBg.png);
    10. border: 1px solid #7a7a7a;
    11. border-bottom-color: #ffffff;
    12. border-top-left-radius: 4px;
    13. border-top-right-radius: 4px;
    14. padding: 2px 6px 2px 6px;}
    15. QTabBar:tab:selected, QTabBar:tab:hover {
    16. background-image: url(:/Styles/styles/tabBarBg_hover.png);
    17. }
    18. QTabBar:tab:!selected { margin-top: 2px;}
    19. QTabBar:tab:selected {
    20. margin-left: -4px;
    21. margin-right: -4px;
    22. }
    23. QTabBar:tab:first:selected { margin-left: 0;}
    24. QTabBar:tab:last:selected { margin-right: 0;}
    25. QTabBar:tab:only-one { margin: 0;}
    To copy to clipboard, switch view to plain text mode 

    Any tip?

    Thanks!!

    Cheers.
    Last edited by wysota; 5th December 2007 at 07:53. Reason: Reformatted to look better. Note: Please stop pasting links to images hosted on external sites
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  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: QTabWidget stylesheet

    Have you tried using QTabBar::tab:first { ... } ? You could change a margin or enforce a minimal width.

  3. #3
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default Re: QTabWidget stylesheet

    Quote Originally Posted by wysota View Post
    Have you tried using QTabBar::tab:first { ... } ? You could change a margin or enforce a minimal width.
    Yeah I could do that, but that was not my question... why does now fails and before not? and why occurs in the first tab and not in the others?

    I just did min-width: 10ex; in the hole tab stylesheet... but i was wondering what happen and why... should work as i have i think...

    Thanks.

    Cheers.
    Last edited by GuS; 6th December 2007 at 22:08.
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  4. #4
    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: QTabWidget stylesheet

    Maybe some "bug" was "corrected" or a bug was corrected

Similar Threads

  1. StyleSheet Problem with QTabWidget
    By December in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:16
  2. add a label in a QTabWidget
    By sabeesh in forum Qt Programming
    Replies: 2
    Last Post: 1st August 2007, 07:36
  3. Adding QGroupBox to QTabWidget
    By mclark in forum Newbie
    Replies: 2
    Last Post: 17th January 2007, 16:27
  4. QTabWidget Placement and Display
    By mclark in forum Newbie
    Replies: 1
    Last Post: 16th January 2007, 20:34
  5. Corner widget in QTabWidget doesn't show up
    By ePharaoh in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2006, 17:02

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.