From 8a14a01f49c973a4ee119028ff1090cbd8e2eea1 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Tue, 22 Apr 2025 21:56:47 +0200 Subject: [PATCH] Anchor header depending on qt version BUG: 503154 --- src/main.cpp | 7 +++++++ src/qml/Main.qml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 009c95bdb..75d8f8dfd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,6 +117,13 @@ int main(int argc, char *argv[]) // pass name of style to qml engine.rootContext()->setContextProperty(QStringLiteral("styleName"), QQuickStyle::name()); + // pass to qml whether qt version is higher or equal to 6.9 +#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) + engine.rootContext()->setContextProperty(QStringLiteral("qtAbove69"), true); +#else + engine.rootContext()->setContextProperty(QStringLiteral("qtAbove69"), false); +#endif + QCommandLineParser parser; parser.setApplicationDescription(i18n("Podcast Application")); QCommandLineOption addFeedOption(QStringList() << QStringLiteral("a") << QStringLiteral("add"), diff --git a/src/qml/Main.qml b/src/qml/Main.qml index ae634bdee..74e254a39 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -142,8 +142,8 @@ Kirigami.ApplicationWindow { id: headerLoader active: !Kirigami.Settings.isMobile visible: active - anchors.left: parent.left - anchors.right: parent.right + anchors.left: qtAbove69 ? parent.left : undefined + anchors.right: qtAbove69 ? parent.right : undefined sourceComponent: HeaderBar { focus: true -- GitLab