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

Executing the application

We can now write main.cpp to create the Dialog class and display it:

#include "dialog.h" 
#include <QApplication> 
 
int main(int argc, char *argv[]) 
{ 
    QApplication app(argc, argv); 
    Dialog dialog; 
    dialog.resize(545, 337); 
    dialog.show(); 
    return app.exec(); 
} 

This piece of code is exactly like the Hello World Qt application that we discussed. Instead of a QLabel, we are instantiating the Dialog class we created, resizing the dialog window frame to a predefined value by using the resize() function. Now, the application is ready to build and run. But, before building the application, let us handcode the project file:

QT += widgets 
 
SOURCES +=  
        main.cpp  
        dialog.cpp  
    my_qlabel.cpp 
 
HEADERS +=  
        dialog.h  
    my_qlabel.h 

Now, build the ...

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