I have made a Dialog in PyQt for use it like a plugin under QGIS 2.10
The Dialog works fine like a standalone application, but if I try to call it like a QGIS plugin, I get this error:
AttributeError: 'module' object has no attribute 'QStringList'
There are a similar question here, but it doesn't work for me.
The form is made with Qt Designer
This is a snippet of my Dialog:
from qgis.core import *from PyQt4 import QtCore, QtGui, QtSqlfrom Ui_BuscadorParcelas import Ui_BuscadorParcelas# create the dialog for BuscadorParcelasclass BuscadorParcelasDialog(QtGui.QDialog): def __init__(self): ....................... def PrepararCuadros(self): self.consulta = QtSql.QSqlQuery(self.conexion) if self.consulta: for i in range(self.numCamposLineEdit): cadenaConsulta = "SELECT DISTINCT "+self.campo+" FROM crcc ORDER BY "+self.campo; self.consulta.exec_(cadenaConsulta) self.ListaValores = QtCore.QStringList() ...................................................The last line gives me the error
Edit:I've just read I could change QStringList to python list, but then I couldn't use it for set a completer model
أكثر...
The Dialog works fine like a standalone application, but if I try to call it like a QGIS plugin, I get this error:
AttributeError: 'module' object has no attribute 'QStringList'
There are a similar question here, but it doesn't work for me.
The form is made with Qt Designer
This is a snippet of my Dialog:
from qgis.core import *from PyQt4 import QtCore, QtGui, QtSqlfrom Ui_BuscadorParcelas import Ui_BuscadorParcelas# create the dialog for BuscadorParcelasclass BuscadorParcelasDialog(QtGui.QDialog): def __init__(self): ....................... def PrepararCuadros(self): self.consulta = QtSql.QSqlQuery(self.conexion) if self.consulta: for i in range(self.numCamposLineEdit): cadenaConsulta = "SELECT DISTINCT "+self.campo+" FROM crcc ORDER BY "+self.campo; self.consulta.exec_(cadenaConsulta) self.ListaValores = QtCore.QStringList() ...................................................The last line gives me the error
Edit:I've just read I could change QStringList to python list, but then I couldn't use it for set a completer model
أكثر...