June 2018
Intermediate to advanced
348 pages
8h 45m
English
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 ...