Project directory structure

Tomaz Canabrava tcanabrava at kde.org
Tue Apr 2 11:40:01 PDT 2013


The Qt expert here is Thiago, I'm hust a humble servant. :)
Don't mind using it, we just need to be cautious, and to not name things on
the UI with huge names ( actionExportThingyToDFF for instance. ). the names
of Actions created on the Menu is a action + camelCase of the string on the
menu, so we need to rename a few ( already did that on my mainwindow. )

T


2013/4/2 Dirk Hohndel <dirk at hohndel.org>

> Thiago Macieira <thiago at macieira.org> writes:
>
> > On terça-feira, 2 de abril de 2013 11.08.40, Dirk Hohndel wrote:
> >> >> on a side note, if you are using the ui, the 'on_' methods do an
> >> >> autoconnect, but while this is nice, if you change the name of the
> >> >> variable to anything else, you will have broken but compilled code.
> >> >
> >> > You don't rename widgets :-), and have run-time warnings anyway. But I
> >> > don't mind -- if you prefer connecting signals by hand, that's OK
> with me.
> >> > Anyone else has a different opinion here?
> >>
> >> Magic names worry me. Can you explain how this works and what the
> >> benefits are?
> >
> > The last line of the setupUi function that uic generates is:
> >
> >         QMetaObject::connectSlotsByName(<object var>);
> >
> > <http://qt-project.org/doc/qt-4.8/qmetaobject.html#connectSlotsByName>
> says:
> >
> > Searches recursively for all child objects of the given object, and
> connects
> > matching signals from them to slots of object that follow the following
> form:
> >
> >  void on_<object name>_<signal name>(<signal parameters>);
> >
> > Let's assume our object has a child object of type QPushButton with the
> object
> > name button1. The slot to catch the button's clicked() signal would be:
> >
> >  void on_button1_clicked();
>
> Oh. That is actually really cool and useful.
>
> Yes, renaming that obviously breaks things but I think this makes the
> code cleaner and easier to browse...
>
> While I'm clearly not the Qt expert here - I think I like this.
>
> /D
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130402/bd4868a0/attachment.html>


More information about the subsurface mailing list