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> icon=QtGui.QIcon("pixmaps/todo_list.png")<br>
systray=QtGui.QSystemTrayIcon(icon)<br> #systray.setIcon(icon)<br> menu = QtGui.QMenu()<br> quitAction = menu.addAction('Quit')<br> systray.setContextMenu(menu)<br> quitAction.connect(quitAction, QtCore.SIGNAL("triggered()"), ui.QuitApp)<br>
systray.show()<br> <br> 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>