2010
Jun
03
如果你的Qt应用已经可以在模拟器上运行,你需要更改你的编译环境以便编译出能在Symbian上运行的应用。 设置方法:
在Carbide.C++环境中:
1.在Qt工程右键出来的主菜单中选则Peroperties菜单
2.在弹出的属性窗口里,左边树状菜单里选择Carbide.c++->Build Configurations
3.为Build Configurations增加编译.sis文件的选项,如下图:
2010
May
22
1、在.pro文件中加入QT += sql这句话(我是在倒数第四行加入的);
2、新建.h文件,命名为conncetion.h,在该文件内加入如下代码:
#ifndef CONNECTION_H
#define CONNECTION_H
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlQuery>
static int createConnection()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("mydate.db");
if (!db.open()) {
QMessageBox::critical(0, qApp->tr("Cannot open database"),
qApp->tr("Unable to establish a database connection."
), QMessageBox::Cancel);
return -1;
}
QSqlQuery query;
query.exec("create table Invite ("
"InviteID integer primary key autoincrement,"
"SendId int,"
"Type int)");
query.exec("insert into Invite (SendId,Type) values (1,'0')");
return true;
}
}
#endif // CONNECTION_H
3、在main.cpp中加入#include <QSqlQuery>和#include "conncetion.h",注意:每个使用到SQLite的文件都要引入#include <QSqlQuery>。
......页数1/1
晚上和爸妈吃个饭。 (2月6日)
装修好累哟
(2月4日)
《斯巴达克斯:复仇》 (2月3日)
白
JankoAtWarpSpeed对...