summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kamm <kamm@incasoftware.de>2015-09-02 10:36:40 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-12-22 21:11:58 +0000
commit1e2d35d4880574b20537677729093df279658965 (patch)
tree0cd6b02e54405253c9822e739bc70695c2a2c666
parent64481bcc671892cd140ce5415eaec7fef3e2a35d (diff)
QSystemTrayIcon: Fix double connection with qpa.
install_sys_qpa() is called for each QSystemTrayIcon::show(), leading to spurious calls of user slots if the signal isn't disconnected on remove_sys_qpa(). Task-number: QTBUG-48068 Change-Id: Ic830250c71fee6b584550ab5aabf54289e478fcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Richard Rondu <rondu.richard@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 358e4c38d6..df3c291840 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -693,6 +693,10 @@ void QSystemTrayIconPrivate::install_sys_qpa()
void QSystemTrayIconPrivate::remove_sys_qpa()
{
+ QObject::disconnect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)),
+ q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)));
+ QObject::disconnect(qpa_sys, &QPlatformSystemTrayIcon::messageClicked,
+ q_func(), &QSystemTrayIcon::messageClicked);
qpa_sys->cleanup();
}