PDA

View Full Version : Changing location of plugins



maxoreli
10th April 2012, 10:55
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 default 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.

Spitfire
10th April 2012, 14:32
By default Qt will check the application directory as one of the paths that could contain plugins and other libraries.
Just copy the 'sqldrivers' directory (from plugins) to directory where your binary is and everything should work.

If you want to place it anywhere else, use addLibraryPath() (http://doc.qt.nokia.com/4.7-snapshot/qcoreapplication.html#addLibraryPath) but you will still have to preserve directory structure inside plugins (so the new path would be d:\mylibs\something\sqldrivers ).

Lesiok
10th April 2012, 15:57
Deploying plugins (http://qt-project.org/doc/qt-4.8/deployment-plugins.html)