[PyQt] QPyNullVariant

Phil Thompson phil at riverbankcomputing.com
Thu Jul 12 22:44:38 BST 2012


On Thu, 12 Jul 2012 21:08:11 +0200, Rodolfo Zitellini <xhero.gm at gmail.com>
wrote:
> Hi All,
> I'm trying to run a pyqt software (frescobaldi,
> http://frescobaldi.org/) in macos using macports. I have macports
> 2.1.1 on macosx 10.7.4, xcode 4.3.2 (qt 4.8.2, pyqt 4.9.1, sip 4.13.2,
> for completeness).
> 
> My problem, it seems, is that object will never be null but only
> QPyNullVariant. Eg.:
> 
> language = QSettings().value("language", "")
> if language:
>    #do stuff
> else
>   #fallback
> 
> language is never null: it is either the correct class or
> QPyNullVariant (instead of null!), so it always tests true.
> I'm asking this here in this list since with the old qt for mac 4.7 it
> worked. I also tried the same software on linux, with qt 4.8.1 and
> same pyqt/sip, and it works as is should (i.e. null and not
> QPyNullVariant).
> 
> I initially suspected it could be a compilation configuration option,
> but I could not find anything. Anyone han an idea of what I can be
> doing wrong?

I don't know what you mean by null in this context, but ...

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/incompatibilities.html#pyqt-v4-9-2

...may help.

Phil


More information about the PyQt mailing list