[Qgis-user] forse data type in QTableWidget in QGIS plugin

matteo matteo.ghetta at gmail.com
Wed Mar 2 06:38:18 PST 2016


Hi all,
I'm struggling with a problem in a QGIS plugin.

Very briefly, in Qt Designer I have created a QTableWidget with some
rows. The first one is filled with some default values (int and floats).

I did not find a way to get a list of the data types in the python script.

This in a piece of code of the plugin:

lst = []

for i in range(self.tableWidget.columnCount()):

	itm = self.tableWidget.item(0,i)

        lst.append(itm.type())

but the lst list is made up by zeros (while it sould contain 2 for
QVariant.Integers and 6 for QVariant.Double).

Am I missing something?

Thanks to all

Cheers

Matteo



More information about the Qgis-user mailing list