Answer the question
In order to leave comments, you need to log in
PyQt4 + Win7 - application icon is not removed from the taskbar when hide ()?
It is necessary that when the window is minimized, the application is hidden and the tray icon is shown.
The problem is that when I do self.hide() in hideEvent, the application icon does not disappear from the taskbar
class myWindow(QtGui.QMainWindow):<br/>
<br/>
def __init__(self, parent=None):<br/>
QtGui.QWidget.__init__(self, parent=None)<br/>
<br/>
<br/>
def hideEvent(self, event):<br/>
self.hide()
Answer the question
In order to leave comments, you need to log in
it seems to me that after receiving the hide() signal, the hideEvent that you redefined to the hide() action is called - thus an endless loop is formed. And it turns out that the icon does not disappear because the application is generally frozen.
def hideEvent(self, event):
QtGui.QMainWindow.hideEvent(self, event) # или без self уже не помню.
self.trayIcon = QtGui.QSystemTrayIcon(QtGui.QIcon(“myicon.png”),self) # где myicon.png картинка вашей иконки...
self.trayIcon.show()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question