<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Thanks for your answer !<br>
<br>
You're right, the right way is to implement the event method in my
class :) (I've fund this yesterday evening :) )<br>
<br>
But, I do the trick differently, using self.isMinimized() because my
class is a QDialog subclass.<br>
<br>
Thanks !<br>
Strato<br>
<br>
PS: for the other need of handling the "close" button on the window
manager decoration, I've also found how to solve this.<br>
<br>
David Boddie a écrit :
<blockquote cite="mid:200807230012.57372.david@boddie.org.uk"
type="cite">
<pre wrap="">Strato,
</pre>
<blockquote type="cite">
<pre wrap="">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)
</pre>
</blockquote>
<pre wrap=""><!---->
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
</pre>
</blockquote>
</body>
</html>