On Sunday 02 January 2011 05:30:02 Thomas Perl wrote: > Hi! > > 2011/1/1 Algis Kabaila <akaba...@pcug.org.au>: > > 2. The Qt Designer produced files have many statements > > similar to this: menubar.setObjectName("menubar") > > What practical effect has the "setObjectName" ? > > I can not see it as the program runs as well with > > statements with "setObjectName" removed. > > The object name can be retrieved by other objects (probably > using "objectName()"), whereas the name in Python (i.e. > "menubar") is just a reference to it (like a pointer if you > like) - the object is "bound" to a name in the local (or > global) namespace, but that name is not unique (you could > say "menubar2 = menubar", and both names would refer to the > same object). > > HTH. > Thomas
Thomas, As always, your answer do help, at least in part. I thank you for it! However, as our concern is Python and PySide programs why should you, I or anyone else care about calling other objects in any other way then Python? I just fear that it is possible that one object will attempt to call another object without telling the Python (limited to Python!) programmer that it wants to do that and then fail miserably. And I, doing a newbie to newbie tutorial stuff, will be partly responsible for the failure. To put it briefly, if it is a good practice to use setObjectName on all objects, I would like to know and tell others to do that. Thanks again and the best for the New Year. -- Algis http://akabaila.pcug.org.au _______________________________________________ PySide mailing list PySide@lists.openbossa.org http://lists.openbossa.org/listinfo/pyside