@All Compared to an auto- connection writing a manual connection requires much more time and is more difficult to debug (exp. finding a particular connection in the source – The Goto slot… helps finding the location in the source). In this relatively large project it would take more than a month to repair all connections. I personally like these kinds of automatisms.
Therefore I did some further analysis. First of all the auto-connections are only non reliable in terms of understanding what is going on. But the reported issue here is 100% reproducible.
In fact the moc is not guilty at all and compiles correctly as the dispatcher code being produced by the moc has all the required calls:
void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
MainWindow *_t = static_cast<MainWindow *>(_o);
switch (_id) {
...
case 35: _t->on_firstToolButton_clicked(); break;
case 36: _t->on_prevToolButton_clicked(); break;
case 37: _t->on_nextToolButton_clicked(); break;
case 38: _t->on_lastToolButton_clicked(); break;
case 39: _t→on_navigationLabel_linkH
…
This dispatcher method is called from another method
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { … }
and that one is called from a code section only displayed in assembly code.
Assuming, that the _id for the dispatcher might be wrong I added a breakpoint to check, but while for all other buttons this call is executed, pressing the prev and next button this metacall method not even reached.
As it tends to be reproducible I analysed the source files and with the help of GIT I figured out, that the only difference is in the MainWindow.ui:
...
1968 1968 <property name="locale">
1969 1969 <locale language="English" country="UnitedStates"/>
1970 1970 </property>
1971 <zorder>toolWidget</zorder>
1972 1971 </widget>
1973 1972 <widget class="GraphicsWidget" name="recentPage">
1974 1973 <property name="locale">
...
)* The first two columns are showing the line numbers as shown with GIT before/after
Somehow the designer added the <zorder> key somewhen before yesterday, and re-assigning the slots was removing this line again.
I have to add that the toolWidget is a container with a QGridLayout for all my buttons (about a dozen more) used to fade in and out the buttons simultaneously.
For me it looks like that auto-connections can safely be used, unless a <zorder> key is present in the .ui file.
So the remaining questions are:
What did the designer cause to add the <zorder> key?
Why only 2 QToolbutton were affected, but all others are working Ok?