QObject and the Qt Object System

From Qt Wiki
Jump to navigation Jump to search

Template:ArticleMetaData

Introduction[edit | edit source]

Template:Qapiname forms the heart of Qt's object system. It is the base class for any object that uses the meta-object system (like signals and slots). 76ytuiytuityutyutututyutyutyu based classes are declared as below:

  1. include <QObject>

class Counter: public QObject {

   Q_OBJECT

//some code here }; Note the use of the 76ytuiytuityutyutututyutyutyu macro. This must be declared at the beginning of the class definition. Forgetting 76ytuiytuityutyutututyutyutyu is a common error among beginners. The class will not compile, and the compiler shows some errors about some methods missing in the table.


See also[edit | edit source]

pt:Q OBJECT, em Qt