⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Plugins in qt.conf is not working but QT_PLUGIN_PATH does

  • I use more than one Qt version on my dev. pc. Therefore I created qt.conf file in binary folder to point to my/used/qt.

    Libraries = /home/my/used/x86/qt/usr/local/qt/lib@
    Result: QML application with usage of fonts from .../lib/fonts is working as expected.

    I wrote another app using the sqldriver and therefore my qt.conf looks like:
    Libraries = /home/my/used/x86/qt/usr/local/qt/lib
    Plugins = /home/my/used/x86/qt/usr/local/qt/plugins@
    Result: Db Driver QSQLITE is not available.

    I set up the env variable:
    @export QT_PLUGIN_PATH=/home/my/used/x86/qt/usr/local/qt/plugins@
    Result: The SQL application works as expected.

    I tried to find an environment variable to set the path to the Qt libs and fonts. But I found no solution.

    My goal is to have only one way to configure the application environment. Either qt.conf or system variables.
    Any suggestions or hints?


  • Hi, using qt.conf can in some cases fail, because it's slightly more brittle than exporting QT_PLUGIN_PATH (I've written about it "here":http://www.tripleboot.org/?p=536

    Just guessing, but if you are calling something like QStyleFactory::keys() first thing in main.cpp, that can be the explanation.

    EDIT: forgot, you can also trace the plugins loading in QtCreator, by exporting QT_DEBUG_PLUGINS=1 (or set it in QtCreator/Projects/Build Environment, that worked for me)

Log in to reply