Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
Loading...
Searching...
No Matches
qt_signals::QtSignalsExample Class Reference

A simple class demonstrating Qt's signals and slots. More...

#include <qt_signals.hpp>

Inheritance diagram for qt_signals::QtSignalsExample:

Public Slots

void onMySignal (const QString &message)
 Slot that receives a message.
 

Signals

void mySignal (const QString &message)
 Signal emitted with a message.
 

Public Member Functions

 QtSignalsExample (QObject *parent=nullptr)
 Constructs a new QtSignalsExample object.
 
void emitSignal (const QString &message)
 Emits the signal with the provided message.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ QtSignalsExample()

qt_signals::QtSignalsExample::QtSignalsExample ( QObject *  parent = nullptr)
explicit

Constructs a new QtSignalsExample object.

Parameters
parentPointer to the parent QObject. Defaults to nullptr.

Member Function Documentation

◆ 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
messageThe 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
messageThe 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
messageThe QString message received from the signal.

The documentation for this class was generated from the following files: