From f4dd0828dcc39946835dad6ce416a65d911e2cd5 Mon Sep 17 00:00:00 2001 From: Christoph Schleifenbaum Date: Fri, 11 May 2012 14:35:49 +0200 Subject: Platform-plugin support for QSystemTrayIcon. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement QPlatformSystemTrayIcon providing QPA-plugin-support for system tray icons. Make QSystemTrayIcon use this as new backend. Ported over qsystemtrayicon_mac.mm to qcocoasystemtrayicon.mm to provide Cocoa support for the new interface. It had to be changed to match the interface, especially for icon and menu handling. This interface is made to not use QStyle or QMenu which are related classes of QSystemTrayIcon. It's therefore not introducing QtWidget dependency into the platform plugin. Task-number: QTBUG-20978 Change-Id: I0d0a73835698b3b4f97219d4f5bbcfa2af57dbe2 Reviewed-by: Christoph Schleifenbaum Reviewed-by: Sean Harmer Reviewed-by: Samuel Rødal Reviewed-by: Friedemann Kleint --- .../auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/widgets/util') diff --git a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp index 9a09af0282..f73a99c79c 100644 --- a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp +++ b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp @@ -120,14 +120,14 @@ void tst_QSystemTrayIcon::getSetCheck() void tst_QSystemTrayIcon::supportsMessages() { // ### fixme: Check platforms. -#if defined(Q_WS_QWS) +#if defined(Q_OS_WINCE) QCOMPARE(QSystemTrayIcon::supportsMessages(), false); -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - QCOMPARE(QSystemTrayIcon::supportsMessages(), true); #else const QString platform = QGuiApplication::platformName(); - if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive)) { - QEXPECT_FAIL("", "QTBUG-20978 QSystemTrayIcon is unimplemented for qpa", Abort); + if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive) + && platform.compare(QStringLiteral("windows"), Qt::CaseInsensitive) + && platform.compare(QStringLiteral("cocoa"), Qt::CaseInsensitive)) { + QEXPECT_FAIL("", "QTBUG-20978 QSystemTrayIcon is unimplemented for this platform", Abort); } QCOMPARE(QSystemTrayIcon::supportsMessages(), true); #endif -- cgit v1.2.3