Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Color setting to a dialog has no effect
-
@void PriceChecker::setBaseUrl()
{
QInputDialog dlg;
dlg.setStyleSheet("background-color:black");
QString baseUrl = dlg.getText(m_pMainWidget, "Settings", "Enter BaseURL");
if (!baseUrl.isEmpty())
{
m_settings.setValue("baseurl", baseUrl);
m_settings.sync();
}
}
@The dlg has always same color as its parent widget. I tried to change only the color of lineedit by
@ myDialog->setStyleSheet("QLineEdit { background-color: yellow }");@Also I tried
@qApp->setStyleSheet("QLineEdit { background-color: yellow }");@any of this didin't work.
-
Hi, you only set the styleSheet for a QLineEdit - if that is what you want, QLineEdits should be yellow.
-
Hi,
Also, calling getText that like will completely ignore the settings you made since it's a static function which creates a QInputDialog