Fix crash in headless backend with Qt 6.7.0

This commit is contained in:
Kovid Goyal 2024-04-19 09:07:58 +05:30
parent cc9afd6371
commit 589d926507
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -127,12 +127,10 @@ HeadlessIntegration *HeadlessIntegration::instance()
return static_cast<HeadlessIntegration *>(QGuiApplicationPrivate::platformIntegration()); return static_cast<HeadlessIntegration *>(QGuiApplicationPrivate::platformIntegration());
} }
static QString themeName() { return QStringLiteral("headless"); }
QStringList HeadlessIntegration::themeNames() const #define THEME_NAME "headless"
{
return QStringList(themeName()); QStringList HeadlessIntegration::themeNames() const { return QStringList(THEME_NAME); }
}
// Restrict the styles to "fusion" to prevent native styles requiring native // Restrict the styles to "fusion" to prevent native styles requiring native
// window handles (eg Windows Vista style) from being used. // window handles (eg Windows Vista style) from being used.
@ -155,7 +153,7 @@ public:
QPlatformTheme *HeadlessIntegration::createPlatformTheme(const QString &name) const QPlatformTheme *HeadlessIntegration::createPlatformTheme(const QString &name) const
{ {
return name == themeName() ? new HeadlessTheme() : nullptr; return name == THEME_NAME ? new HeadlessTheme() : nullptr;
} }
QT_END_NAMESPACE QT_END_NAMESPACE