Skip to Content
C++ Reactive Programming
book

C++ Reactive Programming

by Praseed Pai, Peter Abraham
June 2018
Intermediate to advanced
348 pages
8h 45m
English
Packt Publishing
Content preview from C++ Reactive Programming

Qt event model with signals/slots/MOC – an example

In this section, we will create an application to handle mouse events in QLabel. We will override the mouse events in a custom QLabel and handle them in the dialog where the custom label is placed. The approach to this application is as follows:

  1. Create a custom my_QLabel class, inherited from the framework QLabel class, and override the mouse events, such as mouse-move, mouse-pressed, and mouse-leave.
  2. Define the signals that correspond to these events in my_QLabel, and emit them from the corresponding event handlers.
  3. Create a dialog class inherited from the QDialog class, and handcode the positions and layouts of all of the widgets, including the custom widget created to handle mouse events. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in C++

Functional Programming in C++

Ivan Cukic

Publisher Resources

ISBN: 9781788629775Supplemental Content