[Qgis-developer] update QgsDataDefinedButton with QgsMapLayerComboBox

Denis Rouzaud denis.rouzaud at gmail.com
Wed May 11 05:46:36 PDT 2016


Hi Matteo,



On 05/11/2016 02:41 PM, matteo wrote:
> HI devs,
>
> sorry to write again.. but I'm fighting (again) with Qt and QGIS
> widgets..
>
> In the UI I have a simple spinbox and I'd like to add the chance for
> the user to use the data defined properties to update the value in the
> spinbox.
>
> Unfortunately I'm not able to update the QgsMapLayerComboBox widget to
> the QgsDataDefinedButton one.
>
> With a QgsFieldComboBox I found the easy way signal - solot:
>
> layerChanged(QgsMapLayer*) -> setLayer(QgsMapLayer*)
>
> that updates the QgsFieldComboBox (same thing with
> QgsFieldExpressionComboBox).
>
> But I did not find something similar in the QgsDataDefinedButton API.

look at QgsDataDefinedButton::init

That should set up the button for a layer.
It is not a slot though, not sure if you can connect this directly, you
might need to create an intermediate method.


Best wishes,
Denis


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160511/ffe0ae92/attachment.html>


More information about the Qgis-developer mailing list