[PyQt] About QSystemTrayIcon, I Need some tips

René 'Necoro' Neumann lists at necoro.eu
Tue Jul 24 06:09:41 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oh - sorry ...
I just did not realize, that my code only minimized it - and I had a
different callback, which hides the window on minimization - sorry

Regards,
Necoro

Gustavo A. Díaz schrieb:
> Ok, nice tip Necoro! Thanks, but is not what i wanted.
> I have already a context menu which shows and hide the app, but i want to
> replace that by doing on click on the systrayicon (left button click) to
> show and to hide:
> 
> Click on systray, hide...
> Click on systray, show...
> 
> and so on and on...
> 
> By the way could you be more specific to my example app? Sorry to disturb
> you. :$
> 
> Thanks!!
> 
> David:
> 
> Yes, i saw the QT example docs of systray, but does not help me much about
> the problem of when i close the app.
> And like i said, i dont know nothing about C++... indeed is not too
> dificult
> to compare or convert the example to python/qt, but well... i am doing  my
> best.
> I will search later about that problem on QT forums.
> 
> 2007/7/23, lists at necoro.eu <lists at necoro.eu>:
>>
>> Gustavo A. Díaz schrieb:
>> > Another thing i wan to implement is to click on the systray of the app
>> and
>> > hide it, and click again to show it. I was trying but without
>> success...
>> >
>>
>> this is how I've done it:
>>
>> Qt.QObject.connect(self.systray,
>> Qt.SIGNAL("activated(QSystemTrayIcon::ActivationReason)"),
>> self.cb_systray_activated)
>>
>> def cb_systray_activated (self, reason):
>>         if reason != Qt.QSystemTrayIcon.Context: # do not react on
>> context
>> menu
>> calls
>>         if self.windowState() & Qt.Qt.WindowMinimized: # window is
>> minimized
>>                 self.show()
>>                 self.showNormal()
>>         else: # window is not minimized
>>                 self.setWindowState(self.windowState() |
>> Qt.Qt.WindowMinimized)
>>
>> Regards,
>> Necoro
>>
>>
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpYmV4UOg/zhYFuARArjYAJ9SH85kPKb38vZhDpfRdnWN660QNwCdFO9x
Gxyl5U0i00gaCsRnudeBi+I=
=HpDG
-----END PGP SIGNATURE-----


More information about the PyQt mailing list