Results 1 to 2 of 2

Thread: QTabWidget moving tab bug using stylesheet

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation QTabWidget moving tab bug using stylesheet

    Hi,
    I'm using a QTabWidget and I have the stylesheet loaded and set using "App.setStyleSheet".
    When I move the tab on a movable QTabWidget, the text and border is not visible anymore, this is like a rectangle of color, only the close button is visible.
    That only happen if I set the background-color in QWidget of the stylesheet like that :
    Qt Code:
    1. {
    2. background-color: #302F2F;
    3. }
    To copy to clipboard, switch view to plain text mode 
    If I don't set the background-color the moving tab looks the same as before moving.
    Is it a bug of Qt or something I miss ?
    Thanks for the help

  2. #2
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTabWidget moving tab bug using stylesheet

    Minimal code to reproduce the bug (move tab1 or tab2 and you will see the tab becomes gray) :
    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include <QTabWidget>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication a(argc, argv);
    8. a.setStyleSheet("QWidget{background-color: #302F2F;}");
    9. QMainWindow MainWindow;
    10. QTabWidget* TabWidget = new QTabWidget(&MainWindow);
    11. TabWidget->addTab(new QWidget(TabWidget),"Tab1");
    12. TabWidget->addTab(new QWidget(TabWidget),"Tab2");
    13. MainWindow.setCentralWidget(TabWidget);
    14. TabWidget->setMovable(true);
    15. MainWindow.show();
    16. return a.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 
    Link of the QTBUG : https://bugreports.qt.io/browse/QTBUG-45173
    Last edited by Alundra; 23rd March 2015 at 01:28.

Similar Threads

  1. Set stylesheet of a specific QTabWidget
    By hass26 in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2015, 16:14
  2. QTabWidget stylesheet properties
    By Prompt in forum Qt Programming
    Replies: 0
    Last Post: 18th March 2009, 20:29
  3. QTabWidget stylesheet
    By GuS in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2007, 22:31
  4. QFrame/QTabWidget stylesheet.
    By fanat9 in forum Qt Programming
    Replies: 2
    Last Post: 2nd December 2007, 22:24
  5. StyleSheet Problem with QTabWidget
    By December in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22: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.