Let QApplication emit paletteChanged
Only QGuiApplication would emit the signal. Untangling the duplicate code is rather non-trivial, so left alone for now. Fixes: QTBUG-71186 Change-Id: I4021e3b9ff39718562f4fa3a03c092436b559e9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
ccb396b401
commit
4afd9234c2
@ -1444,6 +1444,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
|
||||
else
|
||||
*QApplicationPrivate::set_pal = palette;
|
||||
QCoreApplication::setAttribute(Qt::AA_SetPalette);
|
||||
emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,7 @@ void tst_QApplication::staticSetup()
|
||||
QVERIFY(style);
|
||||
QApplication::setStyle(style);
|
||||
|
||||
bool palette_changed = false;
|
||||
QPalette pal;
|
||||
QApplication::setPalette(pal);
|
||||
|
||||
@ -247,7 +248,11 @@ void tst_QApplication::staticSetup()
|
||||
QApplication::setFont(font);*/
|
||||
|
||||
int argc = 0;
|
||||
QApplication app(argc, 0);
|
||||
QApplication app(argc, nullptr);
|
||||
QObject::connect(&app, &QApplication::paletteChanged, [&palette_changed]{ palette_changed = true; });
|
||||
QVERIFY(!palette_changed);
|
||||
qApp->setPalette(QPalette(Qt::red));
|
||||
QVERIFY(palette_changed);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user