Since template classes cannot contain Q_OBJECT macro and i really need templates i wrote the code similar to this:
class ObjectParent : public QObject
template< typename T >
class TemplateParent : public ObjectParent
class TemplateArgument ;
class MyClass : public TemplateParent< TemplateArgument >
Then i connect some signals to slot1 and slot2 of MyClass instances. First compilations and launches - everything works smoothly. Today i got "no such slot: MyClass::slot2()". Tried to add another "public slots" right before slot2() declaration, tried to do complete rebuild - nothing. Then i just swapped slot1() and slot2() declarations (and definitions since they are in the header too) and everything works again!
What was the reason for QObject::connect() didn't find slot2() slot and why complete rebuilding did nothing where just swapping of two slots' declarations did the thing?