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

Creating the window – setting layouts and alignments

Now, let's write the application code to create the widget window, which contains two label widgets. One label will be used as the mouse area, similar to the previous example, and the latter will be used to display the filtered mouse event and the mouse coordinates.

Let's look into the code in main.cpp as two sections. Initially, we will discuss the code to create and set the layout for the widgets:

#include "rx_eventfilter.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); // Create the application window auto widget = std::unique_ptr<QWidget>(new QWidget()); widget->resize(280,200); // Create and set properties of mouse area label auto label_mouseArea = new QLabel("Mouse ...
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