[Qgis-developer] Use of autoconnect slots?

Larry Shaffer larrys at dakotacarto.com
Wed Mar 1 09:50:47 PST 2017


Hi,

+1 for explicitly defining connections and slots

While I like the ease of having Qt Creator's Designer auto-create the slot
in the class's header for me, I find auto-connected slots are often
problematic when doing complicated set up of a GUI widget, leading to extra
usage of obj::blockSignals(), as opposed to explicitly setting up a
connection at the right time in program flow.

I also think it blurs the separation of declaration and definition, putting
actionable code in a header file that is not just a simple assignment, etc.

Denis wrote:
> I also wonder about direct connections in UI files.
> I've come across one lately and hesitated a bit. Any thoughts?

I also prefer to not leave connections in UI files, unless they are vey
simple cross-widget communication that would usually never be manually
fussed with, like wiring standard default button actions to a dialog
closure, etc. Because, it is so very easy to set up those types of
connections in Designer/Creator.

That said, I'm OK with a policy of no connections in UI files.

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota
----------------------------------
Boundless Desktop and QGIS Support/Development
Boundless Spatial - http://boundlessgeo.com
lshaffer at boundlessgeo.com

On Wed, Mar 1, 2017 at 1:46 AM, Luigi Pirelli <luipir at gmail.com> wrote:

> +100 I always hate on_* stuffs, make the code hard to be traced
> Luigi Pirelli
>
> ************************************************************
> **************************************
> * Boundless QGIS Support/Development: lpirelli AT boundlessgeo DOT com
> * LinkedIn: https://www.linkedin.com/in/luigipirelli
> * Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
> * GitHub: https://github.com/luipir
> * Mastering QGIS 2nd Edition:
> * https://www.packtpub.com/big-data-and-business-
> intelligence/mastering-qgis-second-edition
> ************************************************************
> **************************************
>
>
> On 1 March 2017 at 07:38, Matthias Kuhn <matthias at opengis.ch> wrote:
> > +1, for what it's worth
> >
> > _______________________________________________
> > 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
> _______________________________________________
> 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/20170301/63f7b1e9/attachment.html>


More information about the Qgis-developer mailing list