Hello Thomas,

thank you for these answers.  this helps moving forward.

version info is indeed better this way.

Cheers,

Erik

On Tue, 2011-03-22 at 11:41 +0100, Thomas Perl wrote:
> Hi Erik,
> 
> 2011/3/22 Erik Janssens <[email protected]>:
> > - the QObject.findChildren method as takes for its second argument
> >  an empty string as default, this default argument won't work
> >  using PySide, and raises a TypeError :
> >
> >  TypeError: findChildren expected 2 arguments, got 1
> 
> That's tracked by bug 685, please subscribe to it:
> 
> http://bugs.pyside.org/show_bug.cgi?id=685
> 
> > - PyQt provides QtCore with these properties :
> >
> >  QtCore.QT_VERSION_STR
> >  QtCore.PYQT_VERSION_STR
> >
> >  these seem to be missing from PySide, but are really handy
> >  for logging to make sure a user is using the right versions
> 
> PySide chose a more Pythonic approach to the version string. Check
> this out (the first one is the PySide version, the second one the Qt
> version, and you have the string variant and the tuple variant,
> depending on whether you want to output it or compare it to a minimum
> version):
> 
> >>> import PySide
> >>> PySide.__version__
> '1.0.0'
> >>> PySide.__version_info__
> (1, 0, 0, 'final', 1)
> >>> import PySide.QtCore
> >>> PySide.QtCore.__version__
> '4.7.1'
> >>> PySide.QtCore.__version_info__
> (4, 7, 1)
> 
> > - The documentation of QObject.property states that when no
> >  such property exists, an invalid QVariant will be returned.
> >  I suppose that None will be returned but am not sure ??
> 
> Yes. If you want to figure out if a property does exist or not, you
> can use something like [m.property(i).name() for i in
> range(m.propertyCount())] where "m" is the .metaObject() of your
> object. If the return value of property() is None, check if the
> property name is in the list, and if it is not, the property does not
> exist (otherwise it does exist, but just has its value set to None).
> 
> HTH.
> Thomas


_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to