I'm using Qt 5.9.
I've a problem declaring slots with underscore style in particular when I name it with more then 2 underscores.For example with a void on_stop_treatment() slot, even I don't make a connection, I get QMetaObject::connectSlotsByName: No matching signal for on_stop_treatment().
Anyway, making a connection, even if I get the same message, the slot signal mechanism works. Removing the second underscore I get no error message and the mechanism works. (I also tried deleting the moc file and rebuild)
Declaring your slot with the name
on_stop_treatmentwill clash with the Qt feature called Signal/Slot Automatic ConnectionsQt will detect this specific syntax for your slot, and will try to match
stopwith a QObject namedstopandtreatmentwith a signal of that name declared in the class of the QObject.To achieve this, Qt uses internally
QMetaObject::connectSlotsByName(this);to perform automatic signal/slot connections.