PDA

View Full Version : Qt Creator always weird



giusepped
25th July 2011, 09:10
I know that QT Creator is a working progress project and I prefer it to Eclipse.
But sometimes the setting of the Project working env. is frustrating
I have a project and if I run it from inside Qt Creator I get " QSQl driver not loaded".
If I run it from a command prompt no problem.
Follow the .pro


TEMPLATE = app
TARGET =
DEPENDPATH += . \
debug \
release
INCLUDEPATH += .

# Input
HEADERS += chooselang.h \
data.h \
daticliente.h \
mainwindow.h \
myfilter.h
FORMS += chooselang.ui \
daticliente.ui \
mainwindow.ui
SOURCES += chooselang.cpp \
daticliente.cpp \
main.cpp \
mainwindow.cpp \
myfilter.cpp
RESOURCES += omnivision.qrc
QT += sql \
network \
svg


And this is the output of Qt Creator:


Starting C:\Users\giuseppe\Documents\Programmi\OmniVision\r elease\omnivision.exe...
Lib Path ("C:/Qt/2010.05/qt/plugins", "C:/Users/giuseppe/Documents/Programmi/OmniVision/release")
database clienti= "C:/Users/giuseppe/Documents/Programmi/OmniVision/release/clie.db"
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
Problems with database clients= QSqlError(-1, "Driver not loaded", "Driver not loaded")
C:\Users\giuseppe\Documents\Programmi\OmniVision\r elease\omnivision.exe exited with code 0

I put the entire sqldrivers folder inside release directory.
Any help appreciated

MarekR22
25th July 2011, 09:29
do you have active shadow build?

giusepped
25th July 2011, 09:38
What is? What do you mean with active shadow build?
However, avent after adding this line of code

QCoreApplication::addLibraryPath(QCoreApplication: :applicationDirPath()+"/sqldrivers");
I got the same result

MarekR22
25th July 2011, 11:27
this will not solve problems caused by shadow build.
Qt Creator is designed to handle multiple platforms and multiple Qt versions. By default to prevent interaction between each target Qt Creator cretes seperate directory for each type of build.
Usually this directory is: "../<your project name with qt version appended>" (reletive to project directory).
Solutions:
disable shadow build (in project properties)
OR
copy required files to shadow build directory
OR
try to find way how to autocopy QSQl drivers to destination directory.

giusepped
25th July 2011, 14:59
I think there is something more odd.
Beside not finding the option to switch off Active Shadow,
I copied the sqldrivers folder in everyplace: in release, in debug in the root folder of the project.
Same result.