Hello.<br><br>I am trying to put an icon into the system tray area using QSystemTrayIcon. All work well except when I close the program.<br><br>I put the icon in the area using this code:<br><br>---- <br>&nbsp;&nbsp;&nbsp; icon=QtGui.QIcon(&quot;pixmaps/todo_list.png&quot;)<br>
&nbsp;&nbsp;&nbsp; systray=QtGui.QSystemTrayIcon(icon)<br>&nbsp;&nbsp;&nbsp; #systray.setIcon(icon)<br>&nbsp;&nbsp;&nbsp; menu = QtGui.QMenu()<br>&nbsp;&nbsp;&nbsp; quitAction = menu.addAction(&#39;Quit&#39;)<br>&nbsp;&nbsp;&nbsp; systray.setContextMenu(menu)<br>&nbsp;&nbsp;&nbsp; quitAction.connect(quitAction, QtCore.SIGNAL(&quot;triggered()&quot;),&nbsp; ui.QuitApp)<br>
&nbsp;&nbsp;&nbsp; systray.show()<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; sys.exit(app.exec_())<br>-----<br><br>I have two minor problems:<br><br>1) when I close the program, the icon stay in the tray area until I move the mouse pointer over it, at this point it go away<br>
2) after exiting from the program, I get this error:<br>QApplication::qAppName: Please instantiate the QApplication object first<br><br>I have the feeling that the two problems are connected, but I cannot find a clue<br><br>
I am working with Qt 4.3.3 and PyQt4.3.3.2 under Windows XP<br><br>Any suggestions ?<br><br>thanks in advance<br>Gianluca<br>