From c26c91b2088a05bbe1ed3b529a4b0fc0ea9d3a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 15 Feb 2023 12:36:20 +0100 Subject: macOS: Pick up QWizard background from keyboard assistant via NSBundle As of macOS 10.14 the keyboard assistant background is shipped as part of the compiled asset catalog of the app, so looking it up via a URL will fail. Instead we look it up via NSBundle's dedicated image lookup function, which handles both cases. The logic has also been moved to qwizard.cpp, since the additional plumbing via QPlatformNativeInterface was unnecessary. The keyboard assistant itself no longer shows the background image as of macOS 12, so we might consider doing the same, but the design of the assistant has also changed significantly, so as long as our QWizard layout looks like the old keyboard assistant we keep the background as well. Pick-to: 6.5 6.2 Change-Id: I7d42dd79b285f3518837458864bca6bc353b3b6d Reviewed-by: Timur Pocheptsov --- tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index a9d5359318..8739a01277 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -398,7 +398,7 @@ void tst_QWizard::setPixmap() QVERIFY(wizard.pixmap(QWizard::BannerPixmap).isNull()); QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull()); QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull()); - if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSHighSierra) + if (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::MacOS) QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull()); else QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull()); @@ -406,7 +406,7 @@ void tst_QWizard::setPixmap() QVERIFY(page->pixmap(QWizard::BannerPixmap).isNull()); QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull()); QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull()); - if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSHighSierra) + if (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::MacOS) QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull()); else QVERIFY(page->pixmap(QWizard::BackgroundPixmap).isNull()); -- cgit v1.2.3