Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.3
-
None
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();
}