[PyQt] How can i capture activated signal of Tray Icon??

Hans-Peter Jansen hpj at urpla.net
Wed Nov 10 12:30:11 GMT 2010


Am Tuesday 09 November 2010 15:08:29 schrieb Jebagnana Das:
> Thanks Zoltan.. It did help a lot.. But if i want to capture single click
> and double click events of the mouse separately i'm afraid this can't be
> used..
>
> def onTrayIconActivated(self, reason):
>         if reason == QSystemTrayIcon.DoubleClick:
>             print('tray icon double clicked')
>
>         if reason == QSystemTrayIcon.Trigger:
>             print("Tray icon single clicked")
>
> If i double click the tray icon it executes both if conditions. Any way of
> resolving this?. Thanks again..

elif instead of second if perhaps?

Pete


More information about the PyQt mailing list