you mean:<br>alpha=pyqtProperty(get_alpha, set_alpha)<br><br>produce:<br>TypeError: type 'function' is not supported as a property type<br><br>should I import something specific ?<br>here are my actual import<br>from PyQt4.QtCore import *<br>
from PyQt4.QtGui import *<br>from PyQt4.QtSvg import *<br><br><div class="gmail_quote">2010/4/9 Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">On Fri, 9 Apr 2010 22:44:05 +0200, Philippe Crave<br>
<<a href="mailto:philippe.crave@gmail.com">philippe.crave@gmail.com</a>><br>
wrote:<br>
<div><div></div><div class="h5">> Hi,<br>
><br>
> in a QGraphicsObject, I use a StateMachine.<br>
> I have problem using assignProperty.<br>
> I am sure to enter that State, but, it does not change my Class property.<br>
><br>
> this how I assign the property<br>
> self.state_in.assignProperty(self, "alpha", 0)<br>
><br>
> and here is how I define the property in the Class<br>
> def get_alpha(self):<br>
> print 'get'<br>
> return self._alpha<br>
> def set_alpha(self, v):<br>
> print 'set'<br>
> self.setOpacity(v)<br>
> self._alpha = v<br>
> alpha=property(get_alpha, set_alpha)<br>
><br>
> What am I doing wrong ?<br>
<br>
</div></div>Python properties and Qt properties are different things.<br>
<br>
Try using pyqtProperty() instead of property().<br>
<font color="#888888"><br>
Phil<br>
</font></blockquote></div><br>