I am trying to develop a plugin for QGIS 3. For me it is quite the first time really working with pyqgis or python, so there might be something simple I am missing.
I want to use data defined override button within this plugin. If it is checked, the used value should be taken from this button (expression or attribute) instead of a spinbox. This is my layout with the button:
Unfortunately I could not find any documentation or related questions, which explain how to actually use this QgsPropertyOverrideButton
. So I am only able to grab the value from the spinbox. This is my relevant code snipped:
#Check where to gather attributes from: GUI or Layer?
if self.dlg.Isochrones_WalkSpeed_Override.isActive() == True:
WalkSpeed = self.dlg.Isochrones_WalkSpeed_Override.value() #Receiving Value from GUI: DataDefinedOverride
else:
WalkSpeed = self.dlg.Isochrones_WalkSpeed.value() #Receiving Value from GUI: SpinBox
How do I grab the value from there either via an attribute from layer or via a given expression within edit field?
.isActive()
to check if the button is active, but still struggling to figure out how to grab the value.