still not working. using QCoreApplication::addLibrary("plugins") in main doesn't works, using qt.conf w Plugin=plugins also not working, copying the qsqlite in plugins folder or in .exe folder or in plugins/sqldrivers also not working...any other ideas?.......i disable all Qt folders to check one by one if my app needs some extra dll but it looks like just need qsqlite.dll
the code for the connections...
#include "connection.h"
#include <QtCore>
#include <QDir>
#include <QUrl>
#include <QMessageBox>
Connection *Connection::_conn = new Connection;
//create connection singleton
_db.
setDatabaseName(QString("%1/lib/database.sqlite").
arg(QDir::currentPath()));
if(_db.open()){
qDebug()<<"database open";
}else qDebug()<<"database not open";
}
//open connection
Connection *Connection::openConn(){
if(!_conn){
_conn=new Connection();
}return _conn;
}
//close conection
Connection *Connection::closeConn(){
_db.close();
return _conn;
}
return _db;
}
#include "connection.h"
#include <QtCore>
#include <QDir>
#include <QUrl>
#include <QMessageBox>
QSqlDatabase Connection::_db=QSqlDatabase::addDatabase("QSQLITE");
Connection *Connection::_conn = new Connection;
//create connection singleton
Connection::Connection(QObject *parent) : QObject(parent){
_db.setDatabaseName(QString("%1/lib/database.sqlite").arg(QDir::currentPath()));
if(_db.open()){
qDebug()<<"database open";
}else qDebug()<<"database not open";
}
//open connection
Connection *Connection::openConn(){
if(!_conn){
_conn=new Connection();
}return _conn;
}
//close conection
Connection *Connection::closeConn(){
_db.close();
_db.removeDatabase(QSqlDatabase::defaultConnection);
return _conn;
}
QSqlDatabase Connection::db(){
return _db;
}
To copy to clipboard, switch view to plain text mode
maybe some directive am i missing?
Bookmarks