Hi,
On 2010/08/12, at 21:37, Marcelo Lira wrote:
> We had a short discussion on #pyside IRC channel and one point of
> prohibiting the setting of dynamic properties using the constructor
> would allow the programmer to make mistakes without knowing. Mistakes
> such as
>
> obj = QObject(objectname='myName')
>
> This wouldn't set the existing 'objectName' property, instead it would
> create the new 'objectname' one. The programmer wouldn't get any
> feedback and everything would eventually crash at some point.
>
> Nevertheless, the alternative
>
> obj = QObject()
> obj.setProperty('objectname', 'myName')
>
> would result in the same problem, since people rarely check the result
> of setProperty.
> In summation my opinion is that the constructors should not have
> special cases for dynamic Qt properties.
>
> Any thoughts?
You have said pretty much everything, so nothing else to add besides saying
that I agree with you - setting dynamic Qt properties on constructors should
not be allowed due to the same reason you have stated above.
Carlos Gonçalves
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside