Answer the question
In order to leave comments, you need to log in
Is it possible to use define to change the implementation of a function, or what is the best way to do this?
Greetings!
There is an implementation of such a function, which is generated by Qt's MOC generator:
int ClassA::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
....
}
int ClassA::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = InterfaceA::qt_metacall(_c, _id, _a);
....
}
Answer the question
In order to leave comments, you need to log in
Damn, I didn’t answer for the bazaar - the Qt Meta system is thought out very cool!
True, 3 days passed before I figured it out, but now you don’t need to redefine anything, just like fiddling with define.
It was worth digging deeper into qmetatype.h along with the debugger and understanding each step, everything fell into place.
I do not program in C ++, I do not use Qt, but it seems that your moc is a separate tool that participates in the build process. There is no problem after it to run a program in any language that will perform a slightly smarter preprocessing, finding a position in the file ClassA::qt_metacall
and then replacing the first occurrence QObject::qt_metacall
with InterfaceA::qt_metacall
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question