MOC is Qt's Meta Object Compiler. It transforms certain Qt-specific macros into the C++ code and meta information necessary for Qt's signal and slots, RTTI, and the dynamic property system.
The meta-object system is based on three things:
- The QObject class provides a base class for objects that can take advantage of the meta-object system.
- The Q_OBJECT macro inside the private section of the class declaration is used to enable meta-object features, such as dynamic properties, signals, and slots.
- The Meta-Object Compiler (moc) supplies each QObject subclass with the necessary code to implement meta-object features.