If you really need to expose QObject
member functions through your A
and B
classes create an abstract base class (i.e. a class with only pure virtual member functions), say AbstractQObject
, and re-declare there the QObject
member functions you need to expose.
Have A
and B
derive virtually from AbstractQObject
and X
from QDialog
, A
and B
.
This should solve the problem you described, but I suspect you would be better off redesigning your code.