-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
37 lines (29 loc) · 1001 Bytes
/
Copy pathmainwindow.cpp
File metadata and controls
37 lines (29 loc) · 1001 Bytes
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
#include "mainwindow.h"
#include "./ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
home_widget = new HomeWidget(this);
problem_widget = new ProblemWidget(this);
submission_widget = new SubmissionWidget(this);
about_dialog = new AboutDialog(this);
ui->MainPage_stackedWidget->addWidget(home_widget);
ui->MainPage_stackedWidget->addWidget(problem_widget);
ui->MainPage_stackedWidget->addWidget(submission_widget);
ui->MainPage_stackedWidget->setCurrentIndex(0);
connect(ui->All_Problem_Action, &QAction::triggered, [this](){
ui->MainPage_stackedWidget->setCurrentIndex(1);
});
connect(ui->Submission_Action, &QAction::triggered, [this](){
ui->MainPage_stackedWidget->setCurrentIndex(2);
});
connect(ui->AboutThis_Action, &QAction::triggered, [this](){
about_dialog->show();
});
}
MainWindow::~MainWindow()
{
delete ui;
}