https://doc.qt.io/qt-5/qobject.html#Q_OBJECT For important Qt related questions. Signal & Slot Mechanism:- The Meta-Object System Using the Meta-Object Compiler (moc) The Meta-Object Compiler, moc , is the program that handles Qt's C++ extensions . The moc tool reads a C++ header file. If it finds one or more class declarations that contain the Q_OBJECT macro, it produces a C++ source file containing the meta-object code for those classes. Among other things, meta-object code is required for the signals and slots mechanism, the run-time type information, and the dynamic property system. The C++ source file generated by moc must be compiled and linked with the implementation of the class. If you use qmake to create your makefiles, build rules will be included that call the moc when required, so you will not need to use the moc directly. For more background information on moc , see Why Does...