-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.cpp
More file actions
executable file
·47 lines (43 loc) · 1.26 KB
/
Window.cpp
File metadata and controls
executable file
·47 lines (43 loc) · 1.26 KB
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
#include "Window.h"
#include "Monitor.h"
#include "Information.h"
#include "Authentication.h"
#include "Thread.h"
#include "About.h"
#include <QInputDialog>
#include <QMessageBox>
#include <QCoreApplication>
#include <QProcess>
#include <cstdio>
Window::Window(QWidget *parent) : QWidget(parent) {
setFixedSize(650, 600);
setWindowTitle("Overclock");
setWindowIcon(QIcon(":/resources/microchip-solid.svg"));
// Create tab widget
tabWidget = new QTabWidget(this);
createTabWidget();
//Set layout
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(tabWidget);
setLayout(mainLayout);
}
void Window::createTabWidget(){
monitorTab = new Monitor();
informationTab = new Information();
aboutTab = new About();
authenticationTab = new Authentication();
tabWidget->addTab(monitorTab, "Monitor");
tabWidget->addTab(informationTab, "Infomation");
tabWidget->addTab(authenticationTab,"Authentication");
tabWidget->addTab(aboutTab, "About");
}
void Window::closeEvent(QCloseEvent *event) { {
Thread *thread = monitorTab->getThread();
if (thread) {
thread->requestInterruption();
thread->quit();
thread->wait();
}
}
QApplication::quit();
}