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

Matthias Kuhn matthias at opengis.ch
Wed Mar 2 07:35:44 PST 2016


I assume that it's just saved as a string when you fill it in designer?

So in this case you will need to check the value itself (with tricks
like casting to an integer and if unsuccessful casting to a float or
similar).

Matthias

On 03/02/2016 04:17 PM, matteo wrote:
> Hi Matthias,
> thanks for the super quick reply.
>
> So you are saying that I can manually set the item data using
> setData(...) and get the type of that data by data().type()
>
> But in my case the first row of the QWidgetTable is already filled with
> some custom values (I filled it Qt Designer).
>
> When I run the code I cannot get these first row data type (that I want
> to use further in the code).
>
> Am I missing something in your answer?
>
> Thanks again!
>
> Matteo
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source




More information about the Qgis-user mailing list