qtqmetaobject

Qt - Does a derived class inherit its base class's meta properties?


I am working with Qt and came across class hierarchies where a base class (sometimes an abstract class) contains Q_PROPERTY macros; will a derived class inherit each Q_PROPERTY from its base class?


Solution

  • Yes, it will. You can easily check this in your debugger: just set a breakpoint after the view / scene is there and inspeckt one of your QObject-instances. You can access the meta-data and the private data for your object and from your base class.