QT 学习笔记

  1. The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots.
  2. 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.