mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-04 00:06:46 -05:00
This change is similar to the one introduced in the previous commit for `QgsAttributes` . The python call of `setAttribute` expects a `QVariant` as input. sip is able to directly handle `QVariant` but this allocation can be slow. In some cases, it is possible to speed-up the `setAttribute` call by checking the type of the attribute. If the attribute is a boolean, an integer, a float or a string, it is possible to avoid the intermediate sip QVariant allocation done by `sipConvertToType`. Based on some testing, this allows to speed-up a python `setAttribute` call up to 80%. If the python attribute is already a `QVariant`, then one get the same time.