Qt学生管理系统源码


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  StudentManagementSystemaffair.cpp

     文件       1260  2016-10-16 22:51  StudentManagementSystemClass.pic

     文件       2919  2017-03-25 21:29  StudentManagementSystemdebugmoc_affair.cpp

     文件       2858  2017-03-25 21:29  StudentManagementSystemdebugmoc_inputwidget.cpp

     文件       3474  2017-03-25 21:29  StudentManagementSystemdebugmoc_mainwindow.cpp

     文件       2991  2017-03-25 21:29  StudentManagementSystemdebugmoc_photopanel.cpp

     文件     153088  2017-03-25 21:30  StudentManagementSystemdebugStudentManagementSystem.exe

     文件    1381396  2017-03-25 21:30  StudentManagementSystemdebugStudentManagementSystem.ilk

     文件    2771968  2017-03-25 21:30  StudentManagementSystemdebugStudentManagementSystem.pdb

     文件      81180  2017-03-25 21:29  StudentManagementSystemGeneratedFilesqrc_resource.cpp

     文件       2198  2017-03-25 21:29  StudentManagementSystemGeneratedFilesui_mainwindow.h

     文件       2533  2011-06-10 13:05  StudentManagementSysteminputwidget.cpp

     文件        533  2011-06-03 12:51  StudentManagementSysteminputwidget.h

     文件        967  2011-06-08 21:38  StudentManagementSystemmain.cpp

     文件       4800  2011-06-10 13:29  StudentManagementSystemmainwindow.cpp

     文件        958  2011-06-08 20:05  StudentManagementSystemmainwindow.h

     文件        654  2011-06-01 23:14  StudentManagementSystemmainwindow.ui

     文件        985  2011-03-30 13:19  StudentManagementSystem
ext.png

     文件       1882  2011-06-08 21:40  StudentManagementSystemphotopanel.cpp

     文件        430  2011-06-08 20:52  StudentManagementSystemphotopanel.h

     文件        962  2011-03-30 13:19  StudentManagementSystempre.png

     文件        148  2011-06-08 21:35  StudentManagementSystem
esource.qrc

     文件      13485  2011-06-08 21:34  StudentManagementSystemscreen.PNG

     文件        156  2011-06-07 23:07  StudentManagementSystemstudent.cpp

     文件        988  2011-06-08 09:29  StudentManagementSystemstudent.h

     文件    1944576  2017-03-25 21:31  StudentManagementSystemStudentManagementSystem.ncb

     文件        537  2011-06-08 20:10  StudentManagementSystemStudentManagementSystem.pro

     文件      12455  2011-06-10 13:32  StudentManagementSystemStudentManagementSystem.pro.user

     文件      21256  2017-03-25 21:29  StudentManagementSystemStudentManagementSystem.vcproj

     文件       1461  2017-03-25 21:31  StudentManagementSystemStudentManagementSystem.vcproj.j-PC.j.user

............此处省略25个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)