[PyQt] About QSystemTrayIcon, I Need some tips

Gustavo A. Díaz gustavo.diaz at gmail.com
Tue Jul 24 01:23:30 BST 2007


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
>



-- 
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070724/d5c69f56/attachment.html


More information about the PyQt mailing list