moc does not support preprocess?
myobject.h:
- #include <QObject>
- #define DECLARE_FUNC(type, func) \
- public: type func; \
- signals: type sig_##func; \
- protected slots: type slot_##func;
- Q_OBJECT
- DECLARE_FUNC(void hello())
- }
the i use moc to generate moc_myobject.cpp
- moc $DEFINES $INCPATH myobject.h -o moc_myobject.cpp
i find that no signal and slot code in moc_myobject.cpp
but if i use
- cpp $DEFINES $INCPATH myobject.h |moc >moc_myobject.cpp
then this moc_myobject.cpp is what i want.
So i guess moc can not support preprocess well. If it is true, I think it’s better to change the default rule to generate moc_xxx.cpp in Makefile.
2 replies
I was reading some moc related material today, and this was one point that I came across..
http://doc.qt.nokia.com/latest/moc.html
see under “Limitations” section.
You must log in to post a reply. Not a member yet? Register here!



