Ok, never mind, now i did what i wanted with:<br><br>if reason != QtGui.QSystemTrayIcon.Context:<br> self.hide()<br><br>So when i click in the tray, will hide and with another click will show.<br><br>Thats perfects, now i have left the problem about closing the app and not being hide intro the systray
<br>Is the any way to make an event when closing the mainapp (with the close button of the WM) to hide in the systray?<br><br>Thanks!!<br><br><div><span class="gmail_quote">2007/7/23, <a href="mailto:lists@necoro.eu">lists@necoro.eu
</a> <<a href="mailto:lists@necoro.eu">lists@necoro.eu</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Gustavo A. Díaz schrieb:
<br>> Another thing i wan to implement is to click on the systray of the app<br>and<br>> hide it, and click again to show it. I was trying but without<br>success...<br>><br><br>this is how I've done it:<br><br>
Qt.QObject.connect(self.systray,<br>Qt.SIGNAL("activated(QSystemTrayIcon::ActivationReason)"),<br>self.cb_systray_activated)<br><br>def cb_systray_activated (self, reason):<br> if reason != Qt.QSystemTrayIcon.Context
: # do not react on context menu<br>calls<br> if self.windowState() & Qt.Qt.WindowMinimized: # window is minimized<br> self.show()<br> self.showNormal()<br> else: # window is not minimized
<br> self.setWindowState(self.windowState() | Qt.Qt.WindowMinimized)<br><br>Regards,<br>Necoro<br><br><br>_______________________________________________<br>PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">
PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br><br clear="all"><br>-- <br>Gustavo A. Díaz
<br>GDNet Projects<br><a href="http://www.gdnet.com.ar">www.gdnet.com.ar</a>