[PyQt] How to minimize the QMainwindow to the system Tray

Russell Valentine russ at coldstonelabs.org
Mon Mar 8 22:35:29 GMT 2010


Add it to the systray example that comes with PyQt? You would add it to 
the window class.

Nick Gaens wrote:
> Where is the systray-part in that example?
> 
> On Mon, Mar 8, 2010 at 7:32 PM, Russell Valentine <russ at coldstonelabs.org>wrote:
> 
>> Reimplement changeEvent in QMainWindow, something like below:
>>
>>    def changeEvent(self, e):
>>        if(e.type() == QtCore.QEvent.WindowStateChange and
>> self.isMinimized()):
>>            self.hide()
>>            e.accept()
>>            return
>>        else:
>>            super(Window, self).changeEvent(e)
>>
>> sindhuja venkat wrote:
>>
>>> Hi......I am doing an application in PyQt4.
>>> Do anyone know how to reduce the application to the system Tray?
>>> When I click the minimize button, the application should go to the tray.
>>> If anybody knows, your help is most welcome.
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> PyQt mailing list    PyQt at riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>>
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
> 
> 
> 



More information about the PyQt mailing list