資源簡介
仿照C GUI QT 4編程藝術(shù)中的例子寫的,進(jìn)行了一定的修改,修正了書上例子的一些bug,使用了設(shè)計(jì)模式。
代碼片段和文件信息
#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));?//分機(jī)號,只允許0-9999的數(shù)字
????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
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????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個(gè)文件信息
評論
共有 條評論