-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
48 lines (39 loc) · 1.32 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "mainwindow.h"
// Application headers
#include "common/dimensions.h"
#include "ui/batch_generator_widget.h"
#include "ui/preview_widget.h"
#include "ui/settings_widget.h"
// Qt headers
#include <QCoreApplication>
#include <QHBoxLayout>
#include <QTabWidget>
/* ===================== */
/* Main Window */
/* ===================== */
// --- Constructor --- //
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
// Window
setWindowTitle(QString("%1 v%2").arg(QCoreApplication::applicationName(),
QCoreApplication::applicationVersion()));
setMinimumSize(Dimensions::WindowWidth, Dimensions::WindowHeight);
// Central widget
auto central_widget{new QWidget(this)};
setCentralWidget(central_widget);
// Widgets
batch_generator_widget_ = new BatchGeneratorWidget(this);
preview_widget_ = new PreviewWidget(this);
settings_widget_ = new SettingsWidget(this);
// Tab widget
auto tab_widget{new QTabWidget(this)};
tab_widget->addTab(preview_widget_, tr("Preview"));
tab_widget->addTab(batch_generator_widget_, tr("Batch"));
// Layout
auto layout{new QHBoxLayout(central_widget)};
layout->addWidget(settings_widget_);
layout->addWidget(tab_widget);
}
// --- Destructor --- //
MainWindow::~MainWindow() {}