[QGIS-Developer] refresh conditional formatting full row after feature attribut update

Nyall Dawson nyall.dawson at gmail.com
Thu Oct 15 17:20:59 PDT 2020


On Thu, 15 Oct 2020 at 19:41, Häfliger Guido
<guido.haefliger at vogelwarte.ch> wrote:
>
> Hi
>
>
>
> I execute the following code:
>
>
>
>                         selected_feature = layer.selectedFeatures()
>
>                         layer.startEditing()
>
>                         for feature in selected_feature:
>
>                             feature["focus"] = 1
>
>                             layer.updateFeature(feature)
>
>
>
>                         layer.commitChanges()
>
>
>
> The update of the values works  fine, the opened attribute table shows the new attribute values but the conditional formatting in the attribute table (full row) is not applied to the updated features if only one feature is selected. If selected_features contains several features, the conditional formatting works except for the first selected feature, so it is not correct.
>
>
>
> The refresh of conditional formatting works perfectly if the conditional formatting is field based (rule un field focus). The full row conditional formatting is only applied correctly if I close and reopen the attribute table. Is this a bug in full row based conditional formatting

Sounds like a bug to me -- can you reproduce if you make changes from
the QGIS interface itself and without the python code?

Nyall



or do I have to use another method to update the attributes? Exist a
workaround to force the refresh of conditional formatting full row
rules on a opened attribute table?
>
>
>
> Thanks for your help in advance
>
> Guido
>
> ____________________________________________________
>
>
> Dipl. Ing. ETH Guido Häfliger
> EDV/GIS-Spezialist
> Tel. ++41 41 462 97 60
> guido.haefliger at vogelwarte.ch
> www.vogelwarte.ch
>
> Schweizerische Vogelwarte | Seerose 1 | CH-6204 Sempach | Schweiz
>
> Station ornithologique suisse | Seerose 1 | CH-6204 Sempach | Suisse
> Stazione ornitologica svizzera | Seerose 1 | CH-6204 Sempach | Svizzera
> Swiss Ornithological Institute | Seerose 1 | CH-6204 Sempach | Switzerland
>
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list