LieberLieber Embedded Engineer supports Qt Core features such as QObject, QEnum, QSlot and QSignal by extending the class, function and/or attribute with a Q[name] Stereotype.
Implementation taken from the new Components Test Model
By adding the qobject stereotype to a class, the code generation (for C++) will generate the following.
- a header to include QObject
- an inheritance of the QObject base class
- adds the
Q_OBJECTmacro to the class
By adding the qenum stereotype to a class, the code generation (for C++) will generate the following.
- an enumeration to use with another class
- when used inside another class, an attribute with the
QSlot & QSignal
qslot and qsingal Stereotypes can be assigned to operations and will create Qt slots and signals.
In Qt signals and slots are used for communication between objects and are an alternative to callback techniques.
A signal is emitted when a particular event occurs. A slot is a function that is called in response to a particular signal.