资源简介
Qt学生管理系统源码
代码片段和文件信息
#include “affair.h“
Affair::Affair(QWidget *parent): QWidget(parent)
{
te = new QTextEdit;
te->setReadOnly(false);
saveBtn = new QPushButton(tr(“Save“));
preBtn = new QPushButton(tr(“Show Previous“));
newBtn = new QPushButton(tr(“New“));
QHBoxLayout *hl = new QHBoxLayout;
hl->addWidget(newBtn);
hl->addWidget(saveBtn);
hl->addWidget(preBtn);
QVBoxLayout *m = new QVBoxLayout;
m->addWidget(te);
m->addLayout(hl);
this->setLayout(m);
connect(newBtnSIGNAL(clicked())thisSLOT(newaff()));
connect(saveBtnSIGNAL(clicked())thisSLOT(save()));
connect(preBtnSIGNAL(clicked())thisSLOT(pre()));
}
void Affair::newaff()
{
te->setPlainText(““);
te->setReadOnly(false);
}
void Affair::save()
{
QString affstr = te->toPlainText();
QFile file(“affair.daa“);
if(!file.open(QIODevice::Append))
{
QMessageBox::information(NULL“Error““Can‘t write the file!“);
return ;
}
QDataStream out(&file);
out< QMessageBox::information(NULL“News““Saved sucess!“);
file.close();
}
void Affair::pre()
{
QString affstr;
QFile file(“affair.daa“);
if(!file.open(QIODevice::ReadOnly))
{
QMessageBox::information(NULL“Error““Can‘t read the file!“);
return ;
}
static int id = 0;
QDataStream in(&file);
QVector affv;
while(!in.atEnd())
{
in>>affstr;
affv.append(affstr);
}
id = (id - 1 + affv.count()) % affv.count();
te->setPlainText(affv[id]);
te->setReadOnly(true);
file.close();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1678 2011-06-08 16:29 StudentManagementSystem\affair.cpp
文件 1260 2016-10-16 22:51 StudentManagementSystem\Class.pic
文件 2919 2017-03-25 21:29 StudentManagementSystem\debug\moc_affair.cpp
文件 2858 2017-03-25 21:29 StudentManagementSystem\debug\moc_inputwidget.cpp
文件 3474 2017-03-25 21:29 StudentManagementSystem\debug\moc_mainwindow.cpp
文件 2991 2017-03-25 21:29 StudentManagementSystem\debug\moc_photopanel.cpp
文件 153088 2017-03-25 21:30 StudentManagementSystem\debug\StudentManagementSystem.exe
文件 1381396 2017-03-25 21:30 StudentManagementSystem\debug\StudentManagementSystem.ilk
文件 2771968 2017-03-25 21:30 StudentManagementSystem\debug\StudentManagementSystem.pdb
文件 81180 2017-03-25 21:29 StudentManagementSystem\GeneratedFiles\qrc_resource.cpp
文件 2198 2017-03-25 21:29 StudentManagementSystem\GeneratedFiles\ui_mainwindow.h
文件 2533 2011-06-10 13:05 StudentManagementSystem\inputwidget.cpp
文件 533 2011-06-03 12:51 StudentManagementSystem\inputwidget.h
文件 967 2011-06-08 21:38 StudentManagementSystem\main.cpp
文件 4800 2011-06-10 13:29 StudentManagementSystem\mainwindow.cpp
文件 958 2011-06-08 20:05 StudentManagementSystem\mainwindow.h
文件 654 2011-06-01 23:14 StudentManagementSystem\mainwindow.ui
文件 985 2011-03-30 13:19 StudentManagementSystem\next.png
文件 1882 2011-06-08 21:40 StudentManagementSystem\photopanel.cpp
文件 430 2011-06-08 20:52 StudentManagementSystem\photopanel.h
文件 962 2011-03-30 13:19 StudentManagementSystem\pre.png
文件 148 2011-06-08 21:35 StudentManagementSystem\resource.qrc
文件 13485 2011-06-08 21:34 StudentManagementSystem\screen.PNG
文件 156 2011-06-07 23:07 StudentManagementSystem\student.cpp
文件 988 2011-06-08 09:29 StudentManagementSystem\student.h
文件 1944576 2017-03-25 21:31 StudentManagementSystem\StudentManagementSystem.ncb
文件 537 2011-06-08 20:10 StudentManagementSystem\StudentManagementSystem.pro
文件 12455 2011-06-10 13:32 StudentManagementSystem\StudentManagementSystem.pro.user
文件 21256 2017-03-25 21:29 StudentManagementSystem\StudentManagementSystem.vcproj
文件 1461 2017-03-25 21:31 StudentManagementSystem\StudentManagementSystem.vcproj.j-PC.j.user
............此处省略25个文件信息
- 上一篇:华为BMC管理模块介绍及指南
- 下一篇:Qt人事管理系统
评论
共有 条评论