This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.cpp
81 lines (65 loc) · 1.92 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->stackedWidget->addWidget(&processWnd);
ui->stackedWidget->addWidget(&cpuWnd);
ui->stackedWidget->addWidget(&memoryWnd);
ui->stackedWidget->addWidget(&networkWnd);
ui->stackedWidget->addWidget(&fileWnd);
ui->stackedWidget->addWidget(&envWnd);
ui->stackedWidget->addWidget(&sysinfoWnd);
ui->stackedWidget->addWidget(&testWnd);
// btnGroup.setExclusive(false);
// btnGroup.addButton(ui->btnProcess, 0);
// btnGroup.addButton(ui->btnCpu, 1);
// btnGroup.addButton(ui->btnMemory, 2);
// btnGroup.addButton(ui->btnNetwork,3);
// btnGroup.addButton(ui->btnFile,4);
// btnGroup.addButton(ui->btnEnv,5);
// btnGroup.addButton(ui->btnSysInfo,6);
//connect(&btnGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), ui->stackedWidget, &QStackedWidget::setCurrentIndex);
// 设置默认选中的页面
ui->btnProcess->setChecked(true);
ui->stackedWidget->setCurrentIndex(0);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_btnProcess_clicked()
{
ui->stackedWidget->setCurrentIndex(0);
}
void MainWindow::on_btnCpu_clicked()
{
ui->stackedWidget->setCurrentIndex(1);
}
void MainWindow::on_btnMemory_clicked()
{
ui->stackedWidget->setCurrentIndex(2);
}
void MainWindow::on_btnNetwork_clicked()
{
ui->stackedWidget->setCurrentIndex(3);
}
void MainWindow::on_btnFile_clicked()
{
ui->stackedWidget->setCurrentIndex(4);
}
void MainWindow::on_btnEnv_clicked()
{
ui->stackedWidget->setCurrentIndex(5);
}
void MainWindow::on_btnSysInfo_clicked()
{
ui->stackedWidget->setCurrentIndex(6);
}
void MainWindow::on_btnTest_clicked()
{
open_button();
ui->stackedWidget->setCurrentIndex(7);
}