-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcapacity.cpp
More file actions
35 lines (34 loc) · 997 Bytes
/
Copy pathcapacity.cpp
File metadata and controls
35 lines (34 loc) · 997 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
#include "capacity.h"
#include "ui_capacity.h"
#include <QSqlQueryModel>
#include <QDebug>
Capacity::Capacity(QWidget *parent) :
QWidget(parent),
ui(new Ui::Capacity)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
}
Capacity::~Capacity()
{
delete ui;
}
void Capacity::on_volumereturnbnz_clicked()
{
hide();
emit tocapac2system();
}
void Capacity::volumecheck()
{
//QSqlQuery query;
QSqlQueryModel model;
model.setQuery("select*from hjcommon");
int userrow=model.rowCount();
//qDebug()<<"现有普通用户个数:"<<userrow;
model.setQuery("select*from hjadmin");
int adminrow=model.rowCount();
//qDebug()<<"现有管理员个数:"<<adminrow;
ui->label->setText("超级管理员个数: 1 人");
ui->label_2->setText("普通管理员个数: "+QString::number(adminrow-1,10)+"人");
ui->label_3->setText("普通用户个数: "+QString::number(userrow,10)+"人");
}