Tutorial by Examples

Signals and slots are used for communication between objects. The signals and slots mechanism is a central feature of Qt and probably the part that differs most from the features provided by other frameworks. The minimal example requires a class with one signal, one slot and one connection: counte...
The conventional connect syntax that uses SIGNAL and SLOT macros works entirely at runtime, which has two drawbacks: it has some runtime overhead (resulting also in binary size overhead), and there's no compile-time correctness checking. The new syntax addresses both issues. Before checking the synt...
While being better in many regards, the new connection syntax in Qt5 has one big weakness: Connecting overloaded signals and slots. In order to let the compiler resolve the overloads we need to use static_casts to member function pointers, or (starting in Qt 5.7) qOverload and friends: #include &lt...
A simple multiwindow example using signals and slots. There is a MainWindow class that controls the Main Window view. A second window controlled by Website class. The two classes are connected so that when you click a button on the Website window something happens in the MainWindow (a text label i...

Page 1 of 1