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

projetmbc at club-internet.fr projetmbc at club-internet.fr
Wed Nov 10 15:58:04 GMT 2010


Hello,

>>>> elif construct(Even...)  had no effect. 

You could try some uggly thing like the following one :

======================================

def onTrayIconActivated(self, reason):
         clickDetected = 0
 
          if reason == QSystemTrayIcon.DoubleClick:
              clickDetected += 1
          elif reason == QSystemTrayIcon.Trigger:
              clickDetected += 1

          if clickDetected == 2:
              print('tray icon double clicked')
          elif clickDetected == 1:
              print("Tray icon single clicked")
======================================

Christophe
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101110/3a5b2892/attachment.html>


More information about the PyQt mailing list