日期:2014-05-16  浏览次数:20613 次

请问:在Qt中定义类时,第一行老是有 Q_OBJECT ,这是什么意思啊,有什么作用啊?
在Qt中定义类时,第一行老是有   Q_OBJECT   ,这是什么意思啊,有什么作用啊?

------解决方案--------------------
The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots
------解决方案--------------------
只有加入了Q_OBJECT,你才能使用QT中的signal和slot机制。