DesignerDemo Example

#include <QApplication>
#include <QScreen>
#include "mainwindow.h"

/* MainWindow */
MainWindow::MainWindow(QWidget* parent)
    : NavigationMainWindow(parent)
{
    ui.setupUi(this);

#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
    const QRect availableGeometry = screen()->availableGeometry();
#else
    QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
#endif
    resize(QSize(2 * availableGeometry.width() / 3, 2 * availableGeometry.height() / 3));
    move(QPoint((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2));
}

MainWindow::~MainWindow()
{
}