It's very important to learn how to optimize your form-based Qt 5 applications that are built with C++. The best way to do that is to learn how to measure and compare different methods that are used and decide which one works the best for you.
Optimizing form and C++
How to do it...
Let's get started by following these steps:
- Let's create a Qt Widgets Application project and open up mainwindow.cpp. After that, add the following headers to the top of the source code:
#include <QPushButton>
#include <QGridLayout>
#include <QMessageBox>
#include <QTime>
#include <QDebug>
- Create a QGridLayout object and set its parent as centralWidget:
MainWindow::MainWindow(QWidget *parent) : QMainWindow...