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

QGraphicsProxyWidget: Selected QLineEdit text gets gray background on Windows XP

    XMLWordPrintable

Details

    Description

      When a QLineEdit is used in a QGraphicsScene + QTabWidget, the selected text is grey and not blue.

      Example code:

      #include <QtCore>
      #include <QtGui>

      int main(int argc, char* argv[]) {
      QApplication app(argc, argv);

      QMainWindow* mainWindow = new QMainWindow;

      // Create widget for tab 1
      QWidget* tab1 = new QLabel("Test label", mainWindow);

      // Create widget for tab 2
      QGraphicsScene* graphicsScene = new QGraphicsScene(mainWindow);
      QGraphicsView* tab2 = new QGraphicsView(graphicsScene, mainWindow);
      QLineEdit* lineEdit = new QLineEdit("Test value");
      QGraphicsProxyWidget* lineEditItem = new QGraphicsProxyWidget;
      lineEditItem->setWidget(lineEdit);
      graphicsScene->addItem(lineEditItem);

      QTabWidget* tabWidget = new QTabWidget(mainWindow);
      tabWidget->addTab(tab1, "Tab 1");
      tabWidget->addTab(tab2, "Tab 2");
      mainWindow->setCentralWidget(tabWidget);

      tabWidget->setCurrentWidget(tab1); // <<<< If this line is used the text on tab 2 get a grey background when selected
      //tabWidget->setCurrentWidget(tab2); // <<<< If this line is used the text on tab 2 get a blue background when selected

      mainWindow->show();

      return app.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            xcm Martin Petersson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes