头文件
#ifndef STUDENTINFO_H
#define STUDENTINFO_H
#include <QtGui>
class studentinfo:public QWidget
{
Q_OBJECT
public slots:
void change1(void);
void dele1(void);
void input1(void);
public:
studentinfo(QWidget *parent=0);
public:
QLabel id2,pass,name,dept;
QPushButton input,change,dele;
QLineEdit idline,passline,nameline,deptline;
};
#endif
实现
#include "myWeiget.h"
#include "studentinfo.h"
#include "studentwin.h"
#include "dbawin.h"
#include "tushuku.h"
#include <QSqlDriver>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QtSql>
studentinfo::studentinfo(QWidget *parent)
:QWidget(parent),id2(QObject::tr("用户名"),this),pass(QObject::tr("密码"),this),
name(QObject::tr("姓名"),this),dept(QObject::tr("院系"),this),
input(QObject::tr("增加"),this),change(QObject::tr("修改"),this),
dele(QObject::tr("删除"),thi