<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Le 11/01/12 19:03, Fabien Lafont a écrit :
<blockquote
cite="mid:CAC9H_chfAsE57+iTWT420MwZRLo_NJYEByvOFTYxKexwCSRpLA@mail.gmail.com"
type="cite">
<pre wrap="">Hello everyone,
I'm trying to use a QCheckBox. I manage to connect it to a "def" but I
want that when I "Uncheck" the QCheckBox it cancel the last action.
In fact I'm adding a line to my code and I want to "comment it" when I reclic:
self.ButtonCroix = QCheckBox("croix")
self.ButtonCroix.stateChanged.connect(self.croix)
def croix(self) :
self.cursor = Cursor(self.ax, useblit=True, color='blue', linewidth=2 )
Thanks in advance,
Fabien
_______________________________________________
PyQt mailing list <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>
</pre>
</blockquote>
What's the problem ?<br>
<br>
In your function croix(), you can verify if the QCheckBox is checked
or not and undo the last action if not.<br>
<br>
<div class="moz-signature">-- <br>
Vincent V.V.<br>
<a href="https://launchpad.net/oqapy">Oqapy</a> . <a
href="https://launchpad.net/qarte+7">Qarte+7</a> . <a
href="https://launchpad.net/paqager">PaQager</a></div>
</body>
</html>