Qt Signals And Slots Observer Pattern

Copyright (C) 2016-2018 David Capello

  1. Qt Connect Signal Slot
  2. Qt Signals And Slots Example
  3. Qt Signals And Slots Observer Pattern Download

Library to use the observer pattern in C++11 programs withobservable/observer classes or signals/slots.

Better pattern observer? Signals and Slots is an improvement to the Observer design pattern. Its used quite extensively in Qt (C) as described here. Here is a related question for Signals and Slots for Java and an implementation in Java. QT's signals and slots is an implementation of the Observer pattern. If you want to know more about it, I recommend reading A Deeper Look at Signals and Slots which motivates it and compares it to Boost signals.

Features

  • Generate an observable notification/signal from multiple threads
  • Add/remove observers/slots from multiple threads
  • Erase/disconnect an observer/slot from the same observable notification/signal
  • Reconnect an observer in the same notification

Observable

An observable Widget:

Qt debug signal and slot

Qt Connect Signal Slot

An example

Qt Signals And Slots Example

Signal

Tested Compilers

Qt Signals And Slots Observer Pattern Download

  • Visual Studio 2015
  • Xcode 7.3.1 (-std=c++11)
  • GCC 4.8.4 (-std=c++11)