Ok, never mind, now i did what i wanted with:<br><br>if reason != QtGui.QSystemTrayIcon.Context:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 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> &lt;<a href="mailto:lists@necoro.eu">lists@necoro.eu</a>&gt;:</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>&gt; Another thing i wan to implement is to click on the systray of the app<br>and<br>&gt; hide it, and click again to show it. I was trying but without<br>success...<br>&gt;<br><br>this is how I&#39;ve done it:<br><br>
Qt.QObject.connect(self.systray,<br>Qt.SIGNAL(&quot;activated(QSystemTrayIcon::ActivationReason)&quot;),<br>self.cb_systray_activated)<br><br>def cb_systray_activated (self, reason):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if reason != Qt.QSystemTrayIcon.Context
: # do not react on context menu<br>calls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if self.windowState() &amp; Qt.Qt.WindowMinimized: # window is minimized<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.show()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.showNormal()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else: # window is not minimized
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.setWindowState(self.windowState() | Qt.Qt.WindowMinimized)<br><br>Regards,<br>Necoro<br><br><br>_______________________________________________<br>PyQt mailing list&nbsp;&nbsp;&nbsp;&nbsp;<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>