April 10, 2012

maxoreli maxoreli
Lab Rat
46 posts

Changing location of plugins

 

I have created an database application that uses QODBC driver, and all worked on my computer. i deployed it on another computer, i get errors when running my application. I remark that Qt has kept the path for accessing to plugins as C:/../../plugins, so i create this same path on client machine before my application works.
Now i want to change the plugins’s path to my directory of my project but i dont know how do it? i have read documentation and i fall on ‘Using qt.conf’ but i dont really understand.

Thanks for advance.

5 replies

April 10, 2012

Andre Andre
Robot Herder
6417 posts

Easiest is to do this file layout:

  1. MyApplication.exe
  2. QtCore4.dll
  3. QtGui4.dll
  4. QtSql4.dll
  5. <other needed Qt libs>
  6. sqldrivers\qodbc4.dll
  7. sqldrivers\qsqlite4.dll
  8. sqldrivers\qmysql4.dll

April 10, 2012

mlong mlong
Robot Herder
1551 posts

You might also want to look at the libraryPaths property in QCoreApplication (and QApplication).

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 13, 2012

maxoreli maxoreli
Lab Rat
46 posts

ok,but if i want to use a customized folder like this:

MyApplication.exe
QtCore4.dll
QtGui4.dll
QtSql4.dll
<other needed Qt libs>
myFolder\qodbc4.dll
myFolder\qsqlite4.dll
myFolder\qmysql4.dll

or my application’paths like this:
MyApplication.exe
QtCore4.dll
QtGui4.dll
QtSql4.dll
<other needed Qt libs>
qodbc4.dll
qsqlite4.dll
qmysql4.dll

How do i do it?

Andre wrote:
Easiest is to do this file layout:
  1. MyApplication.exe
  2. QtCore4.dll
  3. QtGui4.dll
  4. QtSql4.dll
  5. <other needed Qt libs>
  6. sqldrivers\qodbc4.dll
  7. sqldrivers\qsqlite4.dll
  8. sqldrivers\qmysql4.dll

April 16, 2012

1+1=10 1+1=10
Hobby Entomologist
643 posts

All the sql plugin must be in a directory which called sqldrivers , but this directory can be put anywhere.

Otherwise, you need to change the soucecode of Qt.

April 17, 2012

Volker Volker
Ant Farmer
5428 posts
1+1=2 wrote:
All the sql plugin must be in a directory which called sqldrivers , but this directory can be put anywhere.

The default search path is in the exe’s directory + sqldrivers and the Qt installation directory. For putting the plugins subdirectories into other locations one needs to set the library search path of the application (QCoreApplication::addLibraryPath or qtconfig.ini(?)).

 
  ‹‹ [solved] Questions on deployment      [CMake] Windows 8 & Qt ››

You must log in to post a reply. Not a member yet? Register here!