资源简介

仿照C GUI QT 4编程艺术中的例子写的,进行了一定的修改,修正了书上例子的一些bug,使用了设计模式。

资源截图

代码片段和文件信息

#include 
#include 

#include “employeeform.h“
#include “ui_employeeform.h“

EmployeeForm::EmployeeForm(int id QWidget *parent):
    QDialog(parent)
    ui(new Ui::EmployeeForm)
{
    ui->setupUi(this);

    ui->extensionLineEdit->setValidator (new QIntValidator(0 9999 this)); //分机号,只允许0-9999的数字

    ui->buttonBox->addButton (ui->addButton QDialogButtonBox::ActionRole);
    ui->buttonBox->addButton (ui->deleteButton QDialogButtonBox::ActionRole);

    tableModel = new QSqlRelationalTableModel(this);
    tableModel->setTable (“employee“);
    tableModel->setRelation (Employee_DepartmentId QSqlRelation(“department“ “id“ “name“));
    tableModel->setSort (Employee_Name Qt::AscendingOrder);
    tableModel->select ();

    QSqlTableModel *relationM

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     412915  2011-09-21 15:56  GuiQt-ch13-2\debug\employeeform.o

     文件     339234  2011-09-21 16:31  GuiQt-ch13-2\debug\main.o

     文件     414226  2011-09-21 15:56  GuiQt-ch13-2\debug\mainform.o

     文件       2532  2011-09-21 15:56  GuiQt-ch13-2\debug\moc_employeeform.cpp

     文件     127203  2011-09-21 15:56  GuiQt-ch13-2\debug\moc_employeeform.o

     文件       2684  2011-09-21 15:56  GuiQt-ch13-2\debug\moc_mainform.cpp

     文件     126691  2011-09-21 15:56  GuiQt-ch13-2\debug\moc_mainform.o

     文件       3330  2011-09-22 09:04  GuiQt-ch13-2\employeeform.cpp

     文件        856  2011-09-21 20:54  GuiQt-ch13-2\employeeform.h

     文件       6927  2011-09-22 08:39  GuiQt-ch13-2\employeeform.ui

     文件        420  2011-09-21 11:39  GuiQt-ch13-2\GuiQt-ch13-2.pro

     文件      21108  2011-09-22 09:00  GuiQt-ch13-2\GuiQt-ch13-2.pro.user

     文件       5697  2011-09-22 09:14  GuiQt-ch13-2\main.cpp

     文件       5988  2011-09-22 09:06  GuiQt-ch13-2\mainform.cpp

     文件        808  2011-09-21 21:40  GuiQt-ch13-2\mainform.h

     文件       5024  2011-09-22 08:39  GuiQt-ch13-2\mainform.ui

     文件       5867  2011-09-21 16:34  GuiQt-ch13-2\Makefile

     文件       6543  2011-09-21 16:34  GuiQt-ch13-2\Makefile.Debug

     文件       6645  2011-09-21 16:34  GuiQt-ch13-2\Makefile.Release

     文件      31957  2011-09-22 09:04  GuiQt-ch13-2\release\employeeform.o

     文件     151552  2011-09-22 09:14  GuiQt-ch13-2\release\GuiQt-ch13-2.exe

     文件      49039  2011-09-22 09:14  GuiQt-ch13-2\release\main.o

     文件      39862  2011-09-22 09:14  GuiQt-ch13-2\release\mainform.o

     文件       2532  2011-09-21 21:41  GuiQt-ch13-2\release\moc_employeeform.cpp

     文件       8543  2011-09-21 21:41  GuiQt-ch13-2\release\moc_employeeform.o

     文件       2805  2011-09-21 21:41  GuiQt-ch13-2\release\moc_mainform.cpp

     文件       8340  2011-09-21 21:41  GuiQt-ch13-2\release\moc_mainform.o

     文件       9246  2011-09-22 08:39  GuiQt-ch13-2\ui_employeeform.h

     文件       8273  2011-09-22 08:39  GuiQt-ch13-2\ui_mainform.h

     目录          0  2011-09-21 16:32  GuiQt-ch13-2\debug

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

评论

共有 条评论