forked from github188/GAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmgateway.cpp
49 lines (41 loc) · 1.04 KB
/
frmgateway.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
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include "frmgateway.h"
#include "ui_frmgateway.h"
frmGateway::frmGateway(QWidget *parent) :
QWidget(parent),
ui(new Ui::frmGateway)
{
ui->setupUi(this);
this->InitForm();
}
frmGateway::~frmGateway()
{
delete ui;
}
void frmGateway::InitForm()
{
#ifdef __arm__
ui->widget_left->setMinimumWidth(150);
ui->widget_left->setMaximumWidth(150);
#endif
QList<QPushButton *> btns = ui->widget_left->findChildren<QPushButton *>();
foreach (QPushButton * btn, btns) {
connect(btn, SIGNAL(clicked()), this, SLOT(button_clicked()));
}
ui->btnConfig->click();
}
void frmGateway::button_clicked()
{
QPushButton *btn = (QPushButton *)sender();
QString name = btn->text();
QList<QPushButton *> btns = ui->widget_left->findChildren<QPushButton *>();
foreach (QPushButton * b, btns) {
b->setChecked(false);
}
btn->setChecked(true);
if (name == "系统设置") {
ui->stackedWidget->setCurrentIndex(0);
}
}