From 3f3ef052663371b81652f77892f7a217db9969a8 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 6 Dec 2010 14:17:56 +0100 Subject: Revert "QSystemTrayIcon::messageTimeout() signal implemented" This reverts commit 7a5b81532d482b611d5ea8b3a93e6ee9f9098db0. Reverted because the autotest fails. Reviewed-by: Gunnar --- src/gui/util/qsystemtrayicon.cpp | 14 +----- src/gui/util/qsystemtrayicon.h | 1 - src/gui/util/qsystemtrayicon_win.cpp | 4 -- tests/auto/qsystemtrayicon/qsystemtrayicon.pro | 1 - tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp | 56 ---------------------- 5 files changed, 1 insertion(+), 75 deletions(-) diff --git a/src/gui/util/qsystemtrayicon.cpp b/src/gui/util/qsystemtrayicon.cpp index 1c95558..941961b 100644 --- a/src/gui/util/qsystemtrayicon.cpp +++ b/src/gui/util/qsystemtrayicon.cpp @@ -335,16 +335,6 @@ bool QSystemTrayIcon::event(QEvent *e) \sa activated() */ -/*! - \fn void QSystemTrayIcon::messageTimeout() - - This signal is emitted when the message displayed using showMessage() - hides automatically after being shown for the timeout value. - - Currently this signal is not sent on Mac OS X. - - \since 4.8 -*/ /*! Returns true if the system tray is available; otherwise returns false. @@ -667,10 +657,8 @@ void QBalloonTip::timerEvent(QTimerEvent *e) { if (e->timerId() == timerId) { killTimer(timerId); - if (!underMouse()) { + if (!underMouse()) close(); - emit trayIcon->messageTimeout(); - } return; } QWidget::timerEvent(e); diff --git a/src/gui/util/qsystemtrayicon.h b/src/gui/util/qsystemtrayicon.h index 5812d07..0a57e35 100644 --- a/src/gui/util/qsystemtrayicon.h +++ b/src/gui/util/qsystemtrayicon.h @@ -111,7 +111,6 @@ public Q_SLOTS: Q_SIGNALS: void activated(QSystemTrayIcon::ActivationReason reason); void messageClicked(); - void messageTimeout(); protected: bool event(QEvent *event); diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 91b11ef..fc5de44 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -313,10 +313,6 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result ) emit q->messageClicked(); break; - case NIN_BALLOONTIMEOUT: - emit q->messageTimeout(); - break; - case WM_MBUTTONUP: emit q->activated(QSystemTrayIcon::MiddleClick); break; diff --git a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro index a33d072..a77b478 100644 --- a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro +++ b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro @@ -5,6 +5,5 @@ load(qttest_p4) SOURCES += tst_qsystemtrayicon.cpp -win32:LIBS += user32.lib diff --git a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp index f4120ca..b1ec0ff 100644 --- a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp +++ b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp @@ -47,10 +47,6 @@ #include #include -#ifdef Q_OS_WIN32 -#include -#endif - //TESTED_CLASS= //TESTED_FILES= @@ -68,7 +64,6 @@ private slots: void showMessage(); void supportsMessages(); void lastWindowClosed(); - void messageTimeout(); }; tst_QSystemTrayIcon::tst_QSystemTrayIcon() @@ -149,56 +144,5 @@ void tst_QSystemTrayIcon::lastWindowClosed() QVERIFY(spy.count() == 1); } -#ifndef Q_WS_MAC - -static void triggerMessageTimeout() -{ -#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) - // the application has to loose focus on Windows for the message to timeout - INPUT input[2] = {}; - - input[0].type = INPUT_KEYBOARD; - input[0].ki.wVk = VK_LWIN; - input[0].ki.dwFlags = 0; - - input[1].type = INPUT_KEYBOARD; - input[1].ki.wVk = VK_LWIN; - input[1].ki.dwFlags = KEYEVENTF_KEYUP; - - for (int i = 0; i < 2; i++) { - QTest::qWait(100); - ::SendInput(2, input, sizeof(INPUT)); - } -#endif /* defined(Q_WS_WIN) && !defined(Q_WS_WINCE) */ -} - -void tst_QSystemTrayIcon::messageTimeout() -{ - QSystemTrayIcon icon; - if (icon.supportsMessages()) { - icon.setIcon(QIcon("whatever.png")); - icon.show(); - - QObject::connect(&icon, SIGNAL(messageTimeout()), qApp, SLOT(quit())); - QSignalSpy spy(&icon, SIGNAL(messageTimeout())); - icon.showMessage("Title", "Hello World!", QSystemTrayIcon::Information, 1000); - - triggerMessageTimeout(); - - QTimer::singleShot(30000, qApp, SLOT(quit())); // in case the test fails - qApp->exec(); - QVERIFY(spy.count() == 1); - } -} - -#else - -void tst_QSystemTrayIcon::messageTimeout() -{ - // skip the test on Mac OS X -} - -#endif /* Q_WS_MAC */ - QTEST_MAIN(tst_QSystemTrayIcon) #include "tst_qsystemtrayicon.moc" -- cgit v0.12