資源簡介
基于QT4與MySQL的校園點菜系統的實現,初學者學習范例。
代碼片段和文件信息
/********************************************************************************
*?File?Name: main.cpp
*?Description: 第10章實例訓練??????????
*?Reference?book:《Linux環境下Qt4圖形界面與MySQL編程》,機械工業出版社.2012.1??
*?E_mail:?openlinux2011@gmail.com ????????????????
*
********************************************************************************/
#include?
#include?
#include?
#include?“mainwindow.h“
//連接數據庫
bool?createConnection()
{
????QSqlDatabase?db?=QSqlDatabase::addDatabase(“QMYSQL“);?//連接數據庫驅動
????db.setUserName(“root“);???//用戶名
????db.setPassword(“123456“);??//密碼
????db.setHostName(“localhost“);?//數據庫所在主機的IP,此處數據庫存在本地
????db.setDatabaseName(“DinnerSystem“);???//數據庫名
????db.setPort(3306);???//端口
????if(!db.open())?//打開數據庫
????{
????????qDebug()<<“open?faile\
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????363??2011-10-27?10:59??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\data.txt
?????文件????1513433??2011-10-27?19:22??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\DinnerSystem
?????文件????????573??2011-10-27?15:13??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\DinnerSystem.pro
?????文件??????68474??2011-10-27?16:39??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\DinnerSystem.pro.user
?????文件?????252652??2011-04-13?21:31??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\images\22.png
?????文件???????3675??2007-10-16?10:28??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\images\4.png
?????文件???????2037??2010-04-18?23:52??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\images\end.png
?????文件???????1403??2011-12-28?09:46??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\main.cpp
?????文件???????4055??2011-12-28?09:46??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\mainwindow.cpp
?????文件???????1069??2011-12-28?09:46??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\mainwindow.h
?????文件???????7362??2011-10-26?20:17??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\mainwindow.ui
?????文件??????13025??2011-10-27?15:13??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\Makefile
?????文件???????7180??2011-04-13?19:50??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\main.o
?????文件??????29468??2011-04-13?20:00??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\mainwindow.o
?????文件???????8012??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\menulist.o
?????文件???????2148??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_mainwindow.cpp
?????文件???????6736??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_mainwindow.o
?????文件???????1887??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_menulist.cpp
?????文件???????7776??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_menulist.o
?????文件???????1836??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_order.cpp
?????文件???????7696??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_order.o
?????文件???????1921??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_stuaddlist.cpp
?????文件???????7836??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_stuaddlist.o
?????文件???????2653??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeAdmin.cpp
?????文件???????8676??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeAdmin.o
?????文件???????2614??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeStu.cpp
?????文件???????9648??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeStu.o
?????文件???????3066??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeWorker.cpp
?????文件???????9124??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\moc_welcomeWorker.o
?????文件??????11304??2011-04-13?19:51??第10章?基于QT4與MySQL的校園點菜系統\DinnerSystem\release\order.o
............此處省略26個文件信息
評論
共有 條評論