Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Preprocessor macro and Q_INVOKABLE
michael last edited by
I need to declare Q_INVOKABLE method inside a preprocessor macro.
Is it possible? Looks like it does not work.
andre last edited by
No, that is not possible. Q_INVOKABLE is processed by moc, which does not expand macros itself and is run before macros are expanded.
ZapB last edited by
The same is true for many other Q_* "macros". They actually expand to nothing in the preprocessor. They are special keywords used by the meta-object compiler to indicate that it needs to generate some code there.