[PyQt] QWSWindow.raise() class error with python
pyqt at p0w.org
Wed Jul 23 08:54:20 BST 2008
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.
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 :
>> 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
> 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.
> return QWidget.event(self, event)
> Good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt