[Development] Proposal to change connectSlotsByName behavior

Matthew Woehlke mwoehlke.floss at gmail.com
Fri Dec 4 17:46:32 CET 2015


On 2015-12-04 03:01, André Somers wrote:
> On 2015-12-03 21:00, Thiago Macieira wrote:
>> Note that for widgets, the order is not pure luck. The order of 
>> children of a QWidget implies the tabbing order. Therefore, it is
>> usually well-defined.
>
> There are explicit methods for setting the tab order. Relying of the
> order of creation (which may be the default tab order - I did not check)
> is also pure luck, especially with designer-created UI's.

I would have to disagree with that (and agree with Marc). I'm quite
careful (or at least, I try to be) when using Designer to ensure that my
widgets are defined in the .ui file in tab order. I, like Marc, consider
it bad form to override the implicit tab order. (For one, it's a
maintenance headache.)

At any rate, any time I find that my tab order is wrong, I *always* fix
it by changing the order of the widgets in the .ui file.

(p.s. I believe that the order also controls the order in which widgets
are painted. Although this shouldn't matter 99.9% of the time, it does
if you have overlapping widgets.)

IMHO, QWidget::setTabOrder should be used exclusively when you need the
tab order to differ from the child order.

> I'd like to add a new alternative (though it does not exclude a change
> now either):
> 
> - Deprecate the behaviour and remove in Qt 6.
> 
> I have never thought this feature to lead to good design. It makes for
> "magic" in the sense that it is tricky to trace what happened. It leads
> to un-Qt-ish naming of methods, and it leads to naming methods based on
> when they are triggered instead of what they do.

+1.

-- 
Matthew




More information about the Development mailing list