Skip to content

Commit 7b50391

Browse files
committed
Fix build against Qt 6.5 (#133)
1 parent c0934d3 commit 7b50391

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/theme/qgnomeplatformtheme.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ QGnomePlatformTheme::QGnomePlatformTheme()
8787
g_type_ensure(PANGO_TYPE_FONT_FAMILY);
8888
g_type_ensure(PANGO_TYPE_FONT_FACE);
8989

90-
#if QT_VERSION > 0x060000
90+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
9191
// Load QGnomeTheme
9292
m_platformTheme = QGenericUnixTheme::createUnixTheme(QLatin1String("gnome"));
9393
#endif
@@ -175,7 +175,7 @@ QPlatformDialogHelper *QGnomePlatformTheme::createPlatformDialogHelper(QPlatform
175175
}
176176
}
177177

178-
#if QT_VERSION < 0x060000
178+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
179179
#ifndef QT_NO_SYSTEMTRAYICON
180180
static bool isDBusTrayAvailable()
181181
{
@@ -196,7 +196,7 @@ static bool isDBusTrayAvailable()
196196
#ifndef QT_NO_SYSTEMTRAYICON
197197
QPlatformSystemTrayIcon *QGnomePlatformTheme::createPlatformSystemTrayIcon() const
198198
{
199-
#if QT_VERSION < 0x060000
199+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
200200
if (isDBusTrayAvailable()) {
201201
return new QDBusTrayIcon();
202202
}
@@ -209,7 +209,12 @@ QPlatformSystemTrayIcon *QGnomePlatformTheme::createPlatformSystemTrayIcon() con
209209
}
210210
#endif
211211

212-
#if QT_VERSION > 0x060300
212+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
213+
Qt::ColorScheme QGnomePlatformTheme::colorScheme() const
214+
{
215+
return GnomeSettings::getInstance().useGtkThemeDarkVariant() ? Qt::ColorScheme::Dark : Qt::ColorScheme::Light;
216+
}
217+
#elif QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
213218
QPlatformTheme::Appearance QGnomePlatformTheme::appearance() const
214219
{
215220
return GnomeSettings::getInstance().useGtkThemeDarkVariant() ? Appearance::Dark : Appearance::Light;

src/theme/qgnomeplatformtheme.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ class QGnomePlatformTheme : public QPlatformTheme
3939
#ifndef QT_NO_SYSTEMTRAYICON
4040
QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
4141
#endif
42-
#if QT_VERSION > 0x060300
42+
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
43+
Qt::ColorScheme colorScheme() const Q_DECL_OVERRIDE;
44+
#elif QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
4345
QPlatformTheme::Appearance appearance() const Q_DECL_OVERRIDE;
4446
#endif
4547

4648
private:
47-
#if QT_VERSION > 0x060000
49+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
4850
// Used to load Qt's internall platform theme to get access to
4951
// non-public stuff, like QDBusTrayIcon
5052
QPlatformTheme *m_platformTheme = nullptr;

0 commit comments

Comments
 (0)