In my option the correct behavior is not support dynamic properties on constructors, because this can cause a lot of mistakes, and the programmer can generate bugs without knowing. with QObject.serProperty at least you have the return value to verify if you do this wrong, If support dynamic properties on constructor the programmer does not has the feedback to know if something goes wrong.
Ok this is all :D 2010/8/12 Marcelo Lira <[email protected]> > Oh, no, I'm a bad communicator! > I was supporting to allow setting dynamic Qt properties. > The "no special cases" I referred to was not treat differently > existing and dynamic Qt properties, and having to explain to the > developer to avoid using the dynamics because we don't trust him (the > developer, no the property). > > 2010/8/12 Carlos Gonçalves <[email protected]>: > > 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 > > > > -- > Marcelo Lira dos Santos > INdT - Instituto Nokia de Tecnologia > _______________________________________________ > PySide mailing list > [email protected] > http://lists.openbossa.org/listinfo/pyside > -- Renato Araujo Oliveira Filho Instituto Nokia de Tecnologia - INdT Mobile: +55 (81) 8704-2144
_______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
