Set `Qt::AA_EnableHighDpiScaling` only before QGuiApplication is constructed
Otherwise it is too late anyways and Qt might print a warning.
This commit is contained in:
parent
a2482ef37c
commit
d771646af3
|
@ -314,7 +314,9 @@ bool hasCoreApp()
|
||||||
void setupCommonQtApplicationAttributes()
|
void setupCommonQtApplicationAttributes()
|
||||||
{
|
{
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
if (!QCoreApplication::instance()) {
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||||
|
}
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue