资源简介
采用qt5的学生成绩管理系统,包含学生成绩管理和老师成绩管理两个主要部分,

代码片段和文件信息
#include “LoginDialog.h“
#include “ui_LoginDialog.h“
#include
LoginDialog::LoginDialog(QWidget *parent) :
QDialog(parent)
ui(new Ui::LoginDialog)
{
ui->setupUi(this);
//创建QSqlTableModel
model=new QSqlTableModel(this);
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
//设置登录对话框的标题
this->setWindowtitle(“登录“);
//设置登录对话框的图标
this->setWindowIcon(QIcon(“:/student/img/book.jpg“));
//设置登录对话框大小固定为399*252
this->setMaximumSize(399252);
this->setMinimumSize(399252);
//设置调色板用于设置titlelabel的颜色
QPalette p;
p.setColor(QPalette::WindowTextQt::black);
ui->titlelabel->setPalette(p);
//设置调色板用于设置logindialog的背景
QPalette palette;
palette.setBrush(QPalette::BackgroundQBrush(QPixmap(“:/student/img/loginbk1.jpg“).scaled(this->size())));
this->setPalette(palette);
//设置三个按钮的图标
ui->exitbtn->setIcon(QIcon(“:/student/img/exit.png“));
ui->registerbtn->setIcon(QIcon(“:/student/img/log.png“));
ui->loginbtn->setIcon(QIcon(“:/student/img/Enter.png“));
//设置groupbox,放置两个radiobutton
radiogroup=new QButtonGroup(this);
radiogroup->addButton(ui->studentradio0);
radiogroup->addButton(ui->teacherradio1);
//设置图片
ui->piclabel->setPixmap(QPixmap(“:/student/img/log.png“).scaled(ui->piclabel->size()));
//设置登录按钮不可用
ui->loginbtn->setEnabled(false);
//设置lineedit提示语句
ui->userline->setPlaceholderText(“请输入用户名“);
ui->passwordline->setPlaceholderText(“请输入密码“);
//设置passlineedit显示为密码模式
ui->passwordline->setEchoMode(QLineEdit::Password);
//连接信号与槽
connect(ui->loginbtnSIGNAL(clicked())thisSLOT(loginbtnSlot()));
connect(ui->registerbtnSIGNAL(clicked())thisSLOT(registerbtnSlot()));
connect(ui->exitbtnSIGNAL(clicked())thisSLOT(exitbtnSlot()));
//设置登录按钮可用
connect(ui->userlineSIGNAL(textChanged(QString))thisSLOT(loginbtnSetSlot(QString)));
connect(ui->passwordlineSIGNAL(textChanged(QString))thisSLOT(loginbtnSetSlot(QString)));
}
LoginDialog::~LoginDialog()
{
delete ui;
}
void LoginDialog::loginbtnSlot()
{
if(!this->judgeEmpty())
{
ui->passwordline->clear();
return;
}
//判断是否学生登录
if(radiogroup->checkedId()==0)
{
model->setTable(“student“);
model->select();
int i;
for(i=0;irowCount();i++)
{
QSqlRecord record=model->record(i);
if(record.value(0)==ui->userline->text()&&
record.value(5)==ui->passwordline->text())
{
QString str1=“登录成功“;
QString str2=record.value(1).toString();
QString str3=“学生“;
QMessageBox::information(this“提示“str3+str2+str1QMessageBox::Yes);
this->clearAll();
//创建学生成绩管理窗口
student=new StudentManage;
//连接学生成绩管理窗口和登录对话框信号与槽
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-12-08 18:02 StudentSystem\
文件 6663 2015-12-12 01:40 StudentSystem\LoginDialog.cpp
文件 927 2015-12-11 14:17 StudentSystem\LoginDialog.h
文件 7926 2015-12-10 22:27 StudentSystem\LoginDialog.ui
文件 7818 2015-12-12 01:42 StudentSystem\RegisterDialog.cpp
文件 753 2015-12-09 10:45 StudentSystem\RegisterDialog.h
文件 5845 2015-12-09 00:16 StudentSystem\RegisterDialog.ui
文件 4091 2015-12-10 22:46 StudentSystem\StuInfo.cpp
文件 791 2015-12-10 20:56 StudentSystem\StuInfo.h
文件 4632 2015-12-11 00:29 StudentSystem\StuInfo.ui
文件 1717 2015-12-11 13:33 StudentSystem\StuInfoSearch.cpp
文件 626 2015-12-11 13:30 StudentSystem\StuInfoSearch.h
文件 5045 2015-12-11 00:29 StudentSystem\StuInfoSearch.ui
文件 4845 2015-12-10 22:46 StudentSystem\StuPassWord.cpp
文件 714 2015-12-10 21:05 StudentSystem\StuPassWord.h
文件 5009 2015-12-11 15:42 StudentSystem\StuPassWord.ui
文件 5753 2015-12-11 14:48 StudentSystem\StudentManage.cpp
文件 1190 2015-12-11 17:56 StudentSystem\StudentManage.h
文件 7350 2015-12-11 14:17 StudentSystem\StudentManage.ui
文件 1825 2015-12-12 13:10 StudentSystem\StudentSocre.cpp
文件 586 2015-12-11 00:38 StudentSystem\StudentSocre.h
文件 1711 2015-12-11 16:44 StudentSystem\StudentSocre.ui
文件 1299 2015-12-11 21:30 StudentSystem\StudentSystem.pro
文件 33524 2015-12-12 13:11 StudentSystem\StudentSystem.pro.user
文件 4717 2015-12-11 22:37 StudentSystem\TeaPassWord.cpp
文件 720 2015-12-11 22:34 StudentSystem\TeaPassWord.h
文件 4517 2015-12-11 20:38 StudentSystem\TeaPassWord.ui
文件 3058 2015-12-12 02:00 StudentSystem\TeacherChangeScore.cpp
文件 744 2015-12-11 23:53 StudentSystem\TeacherChangeScore.h
文件 2632 2015-12-11 23:57 StudentSystem\TeacherChangeScore.ui
文件 2718 2015-12-12 01:56 StudentSystem\TeacherDelete.cpp
............此处省略62个文件信息
相关资源
- QT局域网聊天系统(基于QT5.修改过)
- QT5.5入门与项目实战
- 基于FFmpeg4.0.2的AAC编码器
- mp4_play.zip
- 使用Qt编写的视频监控系统支持Qt4-Q
- Qt 多线程连接数据库——数据库
- 基于Qt5.8+OpenCV3.2的Basler多相机触发开
- 串口调试助手 Qt5版源码
- Qt5的多线程小程序,实现按钮开关线
- Ubuntu16.04中配置Qt5.9.1和OpenCV3.4.0过程
- Qt pdf poppler
- 基于Qt5的串口调试助手
- Qt类关系图
- PyQt5编写的大数据应用-高速公路违章
- QT5.9.0实现的QWidget版富文本编辑器
- Qt5版NeHe OpenGL教程6-10
- QT5下实现基于TCP发送和接接收文件
- PyQt5_gpl-5.11.3.zip
- qtribbon可用
- qt5串口简单实现图片、pdf文件的传输
- qt5.8实现rtsp流播放
- QT5检测USB设备
- Qt5.5 开发 Creo3.0 案例
-
Qt5.8 QMediaPla
yer 音乐播放器 - qt5-qtwebkit-5.6.2-1.el7.x86_64.rpm
- Qt5 for windows plugin dll
- qt5_V4L2_Camera 实现摄像头实时画面显示
- qml模仿实现的qt creator
- Qt5实战项目之
- qt5音乐播放器更新版 源码
评论
共有 条评论