• 大小: 23KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: 其他
  • 标签: qt  

资源简介

完整的qt学生信息系统程序实现包 保证满意 非常不错 基于qt 连接数据库

资源截图

代码片段和文件信息

#include “addinfo.h“
#include “ui_addinfo.h“
#include “mysql.h“

AddInfo::AddInfo(QWidget *parent) :
    QMainWindow(parent)
    ui(new Ui::AddInfo)
{
    Sparent=(StuInfoManage*) parent;
    ui->setupUi(this);
}

AddInfo::~AddInfo()
{
    delete ui;
}

void AddInfo::on_buttonBox_clicked(QAbstractButton *button)
{
    if(ui->buttonBox->button(QDialogButtonBox::Ok) == button)
    {
        my_stu tran;
        tran.account = ui->acount->text();
        tran.name = ui->name->text();
        tran.sex = ui->sex->currentText();
        tran.age = ui->age->text().toInt();
        tran.identify = ui->identify->text();
        tran.tel = ui->tel->text();
        tran.enroll_time = ui->enroll->text();
        tran.leave_time = ui->leave->text();
        tran.scondition = ui->condition->currentText();
        tran.text = ui->textEdit->toPlainText();

        QProgressDialog dialog(tr(“正在添加“)tr(“取消“) 0 30000 this);
        dialog.setWindowtitle(tr(“进度“));
        dialog.setWindowModality(Qt::WindowModal);
        dialog.show();
        for(int k = 0; k < 30000; k++)
        {
            dialog.setValue(k);
            QCoreApplication::processEvents();
            if(dialog.wasCanceled())
            {
                break;
            }
        }
        dialog.setValue(30000);

        MySql mysql;
        bool ret = mysql.addstu(&tran);
        if(ret == false)
        {
            QMessageBox::information(this tr(“消息“) tr(“添加失败!“) QMessageBox::Ok);
            this->close();
            Sparent->show();
            return;
        }
        QMessageBox::information(this tr(“消息“) tr(“添加成功!“) QMessageBox::Ok);
        this->close();
        Sparent->show();
        return;
    }
    else if(ui->buttonBox->button(QDialogButtonBox::Cancel) == button)
    {
        this->close();
        QProgressDialog dialog(tr(“正在返回主界面“)tr(“取消“) 0 3000 this);
        dialog.setWindowtitle(tr(“进度“));
        dialog.setWindowModality(Qt::WindowModal);
        dialog.show();
        for(int k = 0; k < 3000; k++)
        {
            dialog.setValue(k);
            QCoreApplication::processEvents();
            if(dialog.wasCanceled())
            {
                break;
            }
        }
        dialog.setValue(3000);
        Sparent->show();
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-15 10:40  Student-Information-Manage-System-master\
     文件           0  2018-03-15 10:40  Student-Information-Manage-System-master\README
     文件          36  2018-03-15 10:40  Student-Information-Manage-System-master\README.md
     文件         751  2018-03-15 10:40  Student-Information-Manage-System-master\StudentInfo.pro
     文件       24100  2018-03-15 10:40  Student-Information-Manage-System-master\StudentInfo.pro.user
     文件        2350  2018-03-15 10:40  Student-Information-Manage-System-master\addinfo.cpp
     文件         701  2018-03-15 10:40  Student-Information-Manage-System-master\addinfo.h
     文件        6935  2018-03-15 10:40  Student-Information-Manage-System-master\addinfo.ui
     文件        2406  2018-03-15 10:40  Student-Information-Manage-System-master\changestuinfo.cpp
     文件         514  2018-03-15 10:40  Student-Information-Manage-System-master\changestuinfo.h
     文件        6949  2018-03-15 10:40  Student-Information-Manage-System-master\changestuinfo.ui
     文件        2760  2018-03-15 10:40  Student-Information-Manage-System-master\logging.cpp
     文件         458  2018-03-15 10:40  Student-Information-Manage-System-master\logging.h
     文件        2235  2018-03-15 10:40  Student-Information-Manage-System-master\logging.ui
     文件         303  2018-03-15 10:40  Student-Information-Manage-System-master\main.cpp
     文件        1467  2018-03-15 10:40  Student-Information-Manage-System-master\mainwindow.cpp
     文件         621  2018-03-15 10:40  Student-Information-Manage-System-master\mainwindow.h
     文件        2239  2018-03-15 10:40  Student-Information-Manage-System-master\mainwindow.ui
     文件         340  2018-03-15 10:40  Student-Information-Manage-System-master\manage.cpp
     文件         306  2018-03-15 10:40  Student-Information-Manage-System-master\manage.h
     文件        3091  2018-03-15 10:40  Student-Information-Manage-System-master\manage.ui
     文件        6572  2018-03-15 10:40  Student-Information-Manage-System-master\mysql.cpp
     文件        1207  2018-03-15 10:40  Student-Information-Manage-System-master\mysql.h
     文件        2724  2018-03-15 10:40  Student-Information-Manage-System-master\register.cpp
     文件         489  2018-03-15 10:40  Student-Information-Manage-System-master\register.h
     文件        2799  2018-03-15 10:40  Student-Information-Manage-System-master\register.ui
     文件        3364  2018-03-15 10:40  Student-Information-Manage-System-master\stuinfomanage.cpp
     文件         489  2018-03-15 10:40  Student-Information-Manage-System-master\stuinfomanage.h
     文件        2551  2018-03-15 10:40  Student-Information-Manage-System-master\stuinfomanage.ui

评论

共有 条评论