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
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to