[Qgis-developer] name 'QString' is not defined

Martin Dobias wonder.sk at gmail.com
Fri Apr 4 01:12:52 PDT 2014


On Fri, Apr 4, 2014 at 9:53 AM, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
> Hi Francesco,
>
> I might be not using the right terms, but since the new SIP API (version 2),
> you're not supposed to use Qt types but the standard python types.
> So you're suppose to use str() instead of QString.

To be precise, use 'unicode' type instead of QString, the 'str' type
is equivalent of QByteArray. Using 'str' for text leads to problems
with non-ascii characters.

(In Python3, the 'unicode' type has become 'str' and 'str' type has
become 'bytes' - but QGIS still uses Python2)

Regards
Martin


More information about the Qgis-developer mailing list