Qt-UI

MOC

Signal and Slot Example | | MOC with CMake

The MOC (meta object compiler) generates code that places a MetaCallObject in each class through which a signal is routed from the originating class to the receiving class.

  • Connection of signals and slots is done at run-time.
  • Multiple slots can be connected to a single signal.

C++ Extensions understood and parsed by MOC:

  • Connection is implemented via keywords “connect”, SIGNAL, SLOT
  • Classes with MetaCallObjects are identified via keyword “Q_OBJECT”
  • Slots are identified via “slots” keyword
  • Signals are identified via “signals” keyword


Signal and Slot Example | | MOC with CMake

Options: