Forum QGIS
QgsVectorDataProvider i QList - Wersja do druku

+- Forum QGIS (http://forum.quantum-gis.pl)
+-- Dział: Desktop GIS (http://forum.quantum-gis.pl/forum-4.html)
+--- Dział: QGIS (http://forum.quantum-gis.pl/forum-5.html)
+--- Wątek: QgsVectorDataProvider i QList (/thread-602.html)



QgsVectorDataProvider i QList - Rayo - 30-11-2011

Chcę znaleźć unikalne wartości jednego z atrybutów za pomocą:
Kod:
QgsVectorDataProvider::uniqueValues (int index, QList< QVariant > & uniqueValues, int limit = -1)
Mam jednak problem z typem QList.

Kod wygląda mniej więcej tak
Kod:
lista = QList()
provider.uniqueValues(2,lista)

Moduł QtCore jest zaimportowany.
Pomimo tego otrzymuję błąd: global name 'QList' is not defined

Wie ktoś jak to ugryźć??


RE: QgsVectorDataProvider i QList - borys - 01-12-2011

(30-11-2011, 23:30)Rayo napisał(a): Wie ktoś jak to ugryźć??

Tak. O ile mi wiadomo, typ QList nie jest zaimplementowany w PyQt4. W tego typu przypadkach zazwyczaj w pajtonowych łączach funkcja zwraca wynik, zamiast podstawiać go pod argument:

Kod:
lista = provider.uniqueValues(2)



RE: QgsVectorDataProvider i QList - Rayo - 01-12-2011

Dzięki, działa.