A simple class demonstrating Qt's signals and slots.
More...
#include <qt_signals.hpp>
|
| void | onMySignal (const QString &message) |
| | Slot that receives a message.
|
| |
|
| void | mySignal (const QString &message) |
| | Signal emitted with a message.
|
| |
A simple class demonstrating Qt's signals and slots.
The QtSignalsExample class inherits from QObject and uses the Q_OBJECT macro to enable the meta-object features of Qt, including signals and slots.
◆ QtSignalsExample()
| qt_signals::QtSignalsExample::QtSignalsExample |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
Constructs a new QtSignalsExample object.
- Parameters
-
| parent | Pointer to the parent QObject. Defaults to nullptr. |
◆ emitSignal()
| void qt_signals::QtSignalsExample::emitSignal |
( |
const QString & |
message | ) |
|
Emits the signal with the provided message.
This method demonstrates how to emit a signal.
- Parameters
-
| message | The QString message to be sent with the signal. |
◆ mySignal
| void qt_signals::QtSignalsExample::mySignal |
( |
const QString & |
message | ) |
|
|
signal |
Signal emitted with a message.
This signal is emitted by the QtSignalsExample object to notify connected slots with a QString message.
- Parameters
-
| message | The message being sent. |
◆ onMySignal
| void qt_signals::QtSignalsExample::onMySignal |
( |
const QString & |
message | ) |
|
|
slot |
Slot that receives a message.
This slot is connected to the mySignal signal and handles incoming messages.
- Parameters
-
| message | The QString message received from the signal. |
The documentation for this class was generated from the following files: