Here is what i did, and works (i didn't posted all in my last reply, sorry):
def OnActivated(self, reason): if reason != QtGui.QSystemTrayIcon.Context: self.hide() if self.windowState() & Qt.WindowMinimized: self.showNormal() else: self.setWindowState(self.windowState() | Qt.WindowMinimized) Now i have a weird issue, when i left click on the systray, it does what i want: one click to hide, another click to show and so on... But when i right click, i have seted the context menu inside the systraycode, but it does the same as the left click, it hides and shows then main window and at the same time, it shows the context menu... how i could fix this? Thanks! Cheers. Gustavo A. Díaz GDNet Projects www.gdnet.com.ar René 'Necoro' Neumann escribió: > 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, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > >> 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@riverbankcomputing.com > >> http://www.riverbankcomputing.com/mailman/listinfo/pyqt > >> > > > > > ------------------------------------------------------------------------ > > > _______________________________________________ > > PyQt mailing list PyQt@riverbankcomputing.com > > http://www.riverbankcomputing.com/mailman/listinfo/pyqt > _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- /Gustavo A. Díaz/ *GDNet Projects* www.gdnet.com.ar <http://www.gdnet.com.ar> Gustavo A. Díaz _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt