[Qt-interest] plugins directory
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Thu Dec 16 10:34:03 CET 2010
On 2010-12-16 Pengliang(彭亮) pengliang(彭亮) wrote:
> ...
> Qt4.7.1 into the directory of the program and “addLibraryPath(“the
> program directory”). But it failed. Terminal told me: QSqlDatabase:
> QMYSQL driver not loaded, .
http://doc.trolltech.com/4.7/deployment-plugins.html: "When the application is run, Qt will first treat the application's executable directory as the pluginsbase."
So there is no need to add the application directory to the library path, as this is already part of the "plugin locations" where Qt looks for plugins out of the box.
HOWEVER, you still need to copy the SUB-folders like 'sqldrivers', 'imageformats' etc. into your application directory! That is the simplest deployment approach. Again, addLibraryPath() will only set the "pluginsBASE" directory. From there on Qt expects to find the subfolders like 'sqldrivers' etc.
So:
+ Application Directory
+- sqldrivers
+- theFooDatabaseDriver.so
- ...
+- imageformats
+- ...
Also refer to http://doc.trolltech.com/4.7/plugins-howto.html#locating-plugins
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list