On the basis of the purchased control (no source code), want to add some features of Qobject, have to inherit more:
Class Myprogress:public cprogress, public qobject
But always error:
Release\moc_my_tool.cpp:80:12:error: ' Qt_metacast ' is not a member of ' cprogress '
Return Cprogress::qt_metacast (_clname);
Clear temporary files, recompile a few times, still so, I thought that QT does not support the other class library based on multiple inheritance?
Later brainwave, may want to write qobject in the front, so Q_object macro will immediately unfold, and apply to follow the inheritance class, so change to this:
Class Myprogress:public Qobject, public cprogress
This is the time to compile the line.
Do not know is intentional, or unintentional, Qwidget also first inherit Qobject, and then inherit Qpaintdevice.
------------------------------------------------------------------
It is also noteworthy that, when inheriting, to write two public separately (alas, C + + thinks that human nature is evil, the default is private, this is not the same as the world view of Delphi), otherwise it will error, Some features of Qobject cannot be used for cprogress (such as the Connect function).
Qt multiple inheritance, to put Qobject in the front, otherwise error--c++ think human nature is evil, the default is private, this and Delphi's worldview is not the same