[QGIS-Developer] Signals and QtDesigner

Nyall Dawson nyall.dawson at gmail.com
Thu Feb 29 13:01:22 PST 2024


On Fri, 1 Mar 2024, 5:02 am Jorge Tornero via QGIS-Developer, <
qgis-developer at lists.osgeo.org> wrote:

> Hello all,
>
> I write the list because I have a a simple question (currently I'm trying
> to tackle issue #56275 Improve Parsing of Data from Serial Port Sensors).
>
> Is  using the QtDesigner signal/slot assignment facilities discouraged?
> I've read this in the QGIS coding standards guide and don't really know if
> that means that:
>
> *Avoid use of Qt auto connect slots (i.e. those named void
> on_mSpinBox_valueChanged).*
>
> So, If I need to connect two widgets in a groupBox (a radioButton and a
> QLineEdit, just to enable the QLineEdit only a determinate radioButton is
> selected), should I make it programatically instead using QtDesigner?
>

I realise you posted a follow up, but just to confirm -- yes, do NOT rely
on connections made in the designer.

The rationale is that the designer can break these connections without any
warning. Eg if you cut and paste some widgets to move them around, any
connections to those will be silently broken. It's much safer to rely on
manual connections with compile time checks...

Nyall

>
>
> Thanks a lot
>
> Jorge
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240301/fcef32de/attachment.htm>


More information about the QGIS-Developer mailing list