wirasto
4th March 2011, 03:37
I don't understand why this code not executed when Qt development Framework not installed.
....
....
extern QSqlDatabase dbFav;
void DB::init() // this is static void
{
QDir dir;
if (!dir.exists(CONF_PATH))
dir.mkpath(CONF_PATH);
//favorite
dbFav=QSqlDatabase::addDatabase("QSQLITE", "favorite");
dbFav.setDatabaseName(QString("%1/favorite.%2").arg(CONF_PATH).arg(DB_SUFFIX));
dbFav.open();
QStringList tablesFav = dbFav.tables();
QSqlQuery queryFav(dbFav);
if (!tablesFav.contains("folder", Qt::CaseInsensitive)) {
queryFav.exec("CREATE TABLE folder ("
"id integer primary key,"
"nama text not null,"
"id_induk int not null,"
"unique(nama, id_induk)"
")");
}
}
....
....
extern QSqlDatabase dbFav;
void DB::init() // this is static void
{
QDir dir;
if (!dir.exists(CONF_PATH))
dir.mkpath(CONF_PATH);
//favorite
dbFav=QSqlDatabase::addDatabase("QSQLITE", "favorite");
dbFav.setDatabaseName(QString("%1/favorite.%2").arg(CONF_PATH).arg(DB_SUFFIX));
dbFav.open();
QStringList tablesFav = dbFav.tables();
QSqlQuery queryFav(dbFav);
if (!tablesFav.contains("folder", Qt::CaseInsensitive)) {
queryFav.exec("CREATE TABLE folder ("
"id integer primary key,"
"nama text not null,"
"id_induk int not null,"
"unique(nama, id_induk)"
")");
}
}