<span style="font-family: courier new,monospace;">Hi,<br><br>in a class, I have a QStateMachine, with some QState.<br>I would like to make a targetless transition for one state.<br>I followed the documentation here<br><a href="http://qt.nokia.com/doc/4.6/statemachine-api.html#targetless-transitions">http://qt.nokia.com/doc/4.6/statemachine-api.html#targetless-transitions</a><br>
<br>it works well if the initial event that launch the targetless transition does not include any variables.<br>but now, I emit an event with an increment from a wheelEvent.<br></span><span style="font-family: courier new,monospace;">self.emit(SIGNAL(&quot;wheelEvent(int)&quot;), inc)</span><br>
<span style="font-family: courier new,monospace;">I do not know how to propagate that value from that event to the target slot function </span><span style="font-family: courier new,monospace;">self.change_drive</span><span style="font-family: courier new,monospace;">.<br>
<br>actually, I get this error message:<br>TypeError: change_drive() takes exactly 2 arguments (1 given)<br><br>here is a part of my class<br>...<br>t = QSignalTransition(self, SIGNAL(&quot;wheelEvent(int)&quot;))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">self.state_in.addTransition(t)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">self.connect(t, SIGNAL(&quot;triggered()&quot;), self.change_drive)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">       </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@pyqtSignature(&quot;int&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">def change_drive(self, v):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    print &#39;change_drive&#39;, v</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">       </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> def wheelEvent(self, e):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    inc = cmp(e.delta(), 0) * -1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    self.emit(SIGNAL(&quot;wheelEvent(int)&quot;), inc)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">thank you</span><br style="font-family: courier new,monospace;">