qgis / pyqgis-api-docs-builder

Sphinx project to build python API documentation for QGIS
https://qgis.org/pyqgis/master/
GNU General Public License v2.0
86 stars 31 forks source link

Style rule based on variable not working in QGIS 3.22 #92

Closed jfvilleforceix closed 2 years ago

jfvilleforceix commented 2 years ago

I'm using a QGIS style based on a function which returns the value of a layer variable passed through a pyqgis plugin :

@qgsfunction(args="auto", group="")
def color_trajecto(feature, parent, context):
    color = context.variable("color")
    return color if color else "#ff0000"

Then I put this as entry of an expression for filling the color of my symbol as shown below : 2022-06-21 10_39_41-Éditer une règle

Default value is red, but I passed blue and it is well detected in the filling color bar on its left. But above the color is not taken into account and the symbol as well. This code is working until QGIS 3.16 therefore I presume it's an issue of 3.22.

DelazJ commented 2 years ago

@jfvilleforceix sorry for the late feedback. Issues with QGIS use should be reported at https://github.com/QGIS/issues. This repository is for the PyQGIS documentation management. Thanks.

jfvilleforceix commented 2 years ago

I asked it here : https://github.com/qgis/QGIS/issues/49106

DelazJ commented 2 years ago

Great!