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

Denis Rouzaud denis.rouzaud at gmail.com
Fri Apr 4 00:53:34 PDT 2014


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.

You my find more details here
https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20

Cheers,

Denis


On 04. 04. 14 09:49, Znarf1965 wrote:
> Hi Everybody,
>
> I can't use QString class inside QGis Python Console or inside QGis Python
> plugins.
> If I use inside a stand alone pyw application, I have no problem (please
> note that I run pyw from Eclipse).
>
> Here you are what I do and get inside QGis Python Console:
>
>
> Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on
> WIN-J13S01PK4M5
> ## Type help(iface) for more info and list of methods.
> from PyQt4.QtCore import *
> action = QString()
>
> Traceback (most recent call last):
>    File "<input>", line 1, in <module>
> NameError: name 'QString' is not defined
>
>
> Are there anybody that can suggest me something?...
>
> Best regards
>
> Francesco
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/name-QString-is-not-defined-tp5133044.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the Qgis-developer mailing list