Re: Attribute type change problem while using Qt 5.12 / PyQt 5.12.1 and wildcard imports

Phil Thompson <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <[email protected]>
On 01/05/2019 10:55, Ümit Öztosun wrote:
> Hello,
> 
> I have encountered a weird problem using PyQt 5.12.1 and Qt 5.12. Take
> the following script:
> 
> from PyQt5.QtCore import *
> class A(QObject):
>     flag = True
> a = A()
> print a.flag
> 
> This outputs QCborSimpleType.True. Boolean attribute somehow converted 
> to
> a QCborSimpleType. However, just changing the wildcard import corrects
> output:
> 
> from PyQt5.QtCore import QObject
> class A(QObject):
>     flag = True
> a = A()
> print a.flag
> 
> Output is True this time.
> 
> I have tried various configurations, here are the wildcard import test
> outputs: (Qt/Sip/PyQt all are compiled from source)
> 
> Ubuntu 18.04 / Qt-5.12.3 / sip-4.19.16 / PyQt5_gpl-5.12.1
>  => QCborSimpleType.True
> 
> Ubuntu 18.04 / Qt-5.12.3 / sip-4.19.16 / PyQt5_gpl-5.12.2.dev1904191828
>  => QCborSimpleType.True
> 
> MacOS 10.14.4 / Qt-5.12.3 / sip-4.19.16 / PyQt5_gpl-5.12.1
>  => QCborSimpleType.True
> 
> Ubuntu 18.04 / Qt-5.11.3 / sip-4.19.16 / PyQt5_gpl-5.12.1
>  => True
> 
> Problem only occurs while using Qt-5.12. Using Qt-5.11 brings things to
> normal. AFAIK CBOR support was added in Qt 5.12 and this may be 
> related:
> https://doc.qt.io/qt-5/whatsnew512.html
> 
> Any ideas?

Works fine for me (although I haven't tried it with Python v2). Weird 
things like this are usually build problems, mis-matched versions, old 
things lying around.

Phil
_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.