1 Star 1 Fork 21

maoxianjia / GAS

forked from clickto / GAS 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
frmvisitor.cpp 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
zhao 提交于 2017-03-04 12:30 . 创建版本库 2017-03-04 12:29
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include "frmvisitor.h"
#include "ui_frmvisitor.h"
#include "api/myhelper.h"
frmVisitor::frmVisitor(QWidget *parent) :
QWidget(parent),
ui(new Ui::frmVisitor)
{
ui->setupUi(this);
this->InitForm();
}
frmVisitor::~frmVisitor()
{
delete ui;
}
void frmVisitor::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->btnMain->click();
}
void frmVisitor::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);
} else if (name == "记录查询") {
ui->stackedWidget->setCurrentIndex(1);
} else if (name == "系统设置") {
ui->stackedWidget->setCurrentIndex(2);
}
}
C++
1
https://gitee.com/maoxianjia/GAS.git
git@gitee.com:maoxianjia/GAS.git
maoxianjia
GAS
GAS
master

搜索帮助