91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

大部分大學(xué)一年級(jí)學(xué)生初接觸到的是CC++計(jì)算機(jī)編程語(yǔ)言,而用CC++語(yǔ)言編寫(xiě)界面程序時(shí)多在黑屏白字的 application console下采用文字描述模擬菜單選擇,學(xué)生體驗(yàn)感及成就感較差。而初學(xué)者只有一定的C++面向?qū)ο缶幊袒A(chǔ),可以使用αt輕松實(shí)現(xiàn)圖形界面編程。本文利用Qt圖形庫(kù),采用C++語(yǔ)法,在 Qt Creator集成開(kāi)發(fā)環(huán)境下,實(shí)現(xiàn)了一個(gè)基于Qt的信息管理系統(tǒng)。

資源截圖

代碼片段和文件信息

#include?“dbconnect.h“
#include?“ui_dbconnect.h“
#include?se>
#include?
#include?
#include?
#include?

DbConnect::DbConnect(QWidget?*parent)?:
????QDialog(parent)
????ui(new?Ui::DbConnect)
{
????ui->setupUi(this);
????QStringList?drivers?=?QSqlDatabase::drivers();
????ui->dbComboBox->addItems(drivers);
????ui->status_Label->setText(tr(“狀態(tài):準(zhǔn)備連接數(shù)據(jù)庫(kù)“));
}

DbConnect::~DbConnect()
{
????delete?ui;
}

void?DbConnect::on_submit_clicked()
{
???if(ui->dbComboBox->currentText().isEmpty())
???{
???????ui->status_Label->setText(tr(“請(qǐng)選擇一個(gè)數(shù)據(jù)庫(kù)驅(qū)動(dòng)“));
???????ui->dbComboBox->setFocus();
???}
???else?if(ui->dbComboBox->currentText()==“QSQLITE“)
???{
???????creatDB();
???????accept();
???}
???else

???????QMessageBox::information(thistr(“數(shù)據(jù)庫(kù)“)tr(“對(duì)不起,目前只有’QSQLITE‘驅(qū)動(dòng)可用!“));
}
void?DbConnect::creatDB()
{
????QSqlError?err;
????QSqlDatabase?db?=?QSqlDatabase::addDatabase(“QSQLITE“);
????db.setDatabaseName(“student“);
????db.open();
????if(!db.open())
????{
????????err?=?db.lastError();
????????qDebug()<????}
????else
????ui->status_Label->setText(tr(“創(chuàng)建sqlite數(shù)據(jù)庫(kù)成功“));

????QSqlQuery?query;
????bool?success=query.exec(“create?table?student?(id?int?primary?keyname?varchar(40)age?intmajor?varchar(40)credit?intaddress?varchar(40))“);
????if?(success)
????????qDebug()<ject::tr(“數(shù)據(jù)庫(kù)表創(chuàng)建成功“);
????query.exec(Qobject::tr(“insert?into?student?values(1‘李小龍‘?32?‘截拳道‘?100?‘中國(guó)‘)“));
????query.exec(Qobject::tr(“insert?into?student?values(2‘李四‘?60?‘猴拳‘??80?‘北京‘)“));
????query.exec(Qobject::tr(“insert?into?student?values(3‘張三‘?31?‘跆拳道‘?90?‘上海‘)“));
????query.exec(Qobject::tr(“insert?into?student?values(4‘王五‘?30?‘截拳道‘?88?‘南京‘)“));
????query.exec(Qobject::tr(“insert?into?student?values(5‘小明‘?18?‘截拳道‘??92?‘深圳‘)“));

}
void?DbConnect::on_cancel_clicked()
{
???close();
}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-03-18?15:30??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\
?????文件????????8961??2020-02-21?20:02??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\studentManagerSystem.zip
?????目錄???????????0??2020-02-22?19:45??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\
?????文件????????2104??2017-01-14?21:36??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\dbconnect.cpp
?????文件?????????428??2017-01-14?09:37??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\dbconnect.h
?????文件????????2819??2017-01-14?09:16??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\dbconnect.ui
?????文件?????????314??2017-01-14?19:27??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\main.cpp
?????文件????????8080??2017-01-16?22:18??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\mainwindow.cpp
?????文件????????1349??2017-01-16?22:18??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\mainwindow.h
?????文件?????????451??2017-01-14?09:13??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\StudentMangeSystem.pro
?????文件???????17624??2020-02-22?19:45??基于Qt的信息管理系統(tǒng)設(shè)計(jì)\StudentMangeSystem\StudentMangeSystem.pro.user

評(píng)論

共有 條評(píng)論

相關(guān)資源