Results 1 to 1 of 1

Thread: Problem with TabBar und StyleSheet

  1. #1
    Join Date
    May 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with TabBar und StyleSheet

    hi,

    i have a problem with using a stylesheet and a tabbar (QTabWidget).

    I need a tab bar or tab widget which should be without the standard scrollbutton. The tab bar should show several tabs, e.g. four visible and the rest shall be not shown

    When i switch to the tabs from left to right, everything is shown as i expect.
    But if i change the direction, and a not visible tab "get into the visible area" the tabs are displaced for a few pixel. Look at the added picture.

    Maybe someone has the same problem and can help me?!

    Here the used stylesheet, which is from the given style sheet reference example with only a few changes...

    Qt Code:
    1. QTabWidget::pane { /* The tab widget frame */
    2. border-top: 2px solid #C2C7CB;
    3. position: absolute;
    4. }
    5.  
    6. QTabWidget::tab-bar {
    7. width: 416px;
    8. left:0px;
    9. }
    10.  
    11. /* Style the tab using the tab sub-control. Note that
    12.   it reads QTabBar _not_ QTabWidget */
    13. QTabBar::tab {
    14. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    15. stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
    16. stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
    17. border: 2px solid #C4C4C3;
    18. border-bottom-color: #C2C7CB; /* same as the pane color */
    19. border-top-left-radius: 4px;
    20. border-top-right-radius: 4px;
    21. width: 100px;
    22. }
    23.  
    24. QTabBar::tab:selected, QTabBar::tab:hover {
    25. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    26. stop: 0 #fafafa, stop: 0.4 #f4f4f4,
    27. stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
    28. }
    29.  
    30. QTabBar::tab:selected {
    31. border-color: #9B9B9B;
    32. border-bottom-color: #C2C7CB; /* same as pane color */
    33. }
    34.  
    35. QTabBar::tear {
    36. width: 0px;
    37. }
    38.  
    39. QTabBar::scroller { /* the width of the scroll buttons */
    40. width: 0px;
    41. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.