Q_OBJECT
macro. For instance:class A : public QObject {};
class B {};
class C : public A, public B
{
Q_OBJECT
};
If you do it the other way, (
class C : public B, public A
) you will get errors inside the moc_C.cxx file saying that it couldn't find the QMetaObject members of class B (which it doesn't have) because moc only looks at the first base class listed.There all sorts of other little things like this which you can read about in the Qt moc documentation (for instance, nested classes cannot have signals or slots).
Aucun commentaire:
Enregistrer un commentaire