- The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots.
- Classes that use the Q_OBJECT macro must have moc run on them. This isn’t a problem because qmake automatically adds the necessary rules to the makefile. But if you forget to regenerate your makefile using qmake and moc isn’t run, the linker will complain that some functions are declared but not implemented.
1 thought on “QT 学习笔记”
Comments are closed.
Your place is valueble for me. Thanks!…