[PyQt] QWSWindow.raise() class error with python
Strato
pyqt at p0w.org
Wed Jul 23 08:54:20 BST 2008
Hi,
Thanks for your answer !
You're right, the right way is to implement the event method in my class
:) (I've fund this yesterday evening :) )
But, I do the trick differently, using self.isMinimized() because my
class is a QDialog subclass.
Thanks !
Strato
PS: for the other need of handling the "close" button on the window
manager decoration, I've also found how to solve this.
David Boddie a écrit :
> Strato,
>
>
>> erratum: I've found my mystake about the "minimized()" method of the
>> QWidget class: is not a method, and the real method works: isMinimized() :)
>>
>> btw my main problem (handle when the user click on the minimized button
>> remains)
>>
>
> Unfortunately, as you noticed, there isn't a signal to tell you when the
> user minimizes the window. However, there should be a way to do this by
> monitoring the events sent to the widget. In your widget's class definition,
> add an event() implementation like the following:
>
> class Window(QWidget):
>
> def event(self, event):
>
> if isinstance(event, QHideEvent):
> if self.windowState() & Qt.Minimized != 0:
> # Do something to hide the window.
> self.hide()
>
> return QWidget.event(self, event)
>
> Good luck!
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080723/ede55dd8/attachment.html
More information about the PyQt
mailing list