Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45173

QTabWidget move bug with stylesheet

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.4.1
    • Widgets: Style Sheets
    • None
    • Windows 8.1
    • Change-Id: I07aee0f369fa715d852556620c8e74bcffd836da

    Description

      When background-color is set in QWidget using stylesheet, moving a tab is then bugged. The tab uses the background-color for the full shape and the text is not visible anymore, border is removed too.
      Here minimal code to reproduce the bug :

      #include <QApplication>
      #include <QMainWindow>
      #include <QTabWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          a.setStyleSheet("QWidget{background-color: #302F2F;}");
          QMainWindow MainWindow;
          QTabWidget* TabWidget = new QTabWidget(&MainWindow);
          TabWidget->addTab(new QWidget(TabWidget),"Tab1");
          TabWidget->addTab(new QWidget(TabWidget),"Tab2");
          MainWindow.setCentralWidget(TabWidget);
          TabWidget->setMovable(true);
          MainWindow.show();
          return a.exec();
      }
      

      Move Tab1 or Tab2 to see the bug.

      Attachments

        For Gerrit Dashboard: QTBUG-45173
        # Subject Branch Project Status CR V

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            alundra Michael Ségura
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes