Thursday, 20 August 2015

Help Qt Designer to find plugins

Qt Designer can't find plugins without QT_PLUGIN_PATH being set. You should also set QT_QPA_PLATFORM_PLUGIN_PATH for the Qt gui applications. If you're writing your own Qt exe, you can set these paths internally.
set QTDIR=C:/Qt/qt5_msvc2012_x64_build/qtbase
set QT_PLUGIN_PATH=%QTDIR%/plugins
set QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%/plugins/platforms
Note also that Qt Designer will only load plugins built with the same libraries. And when you do a debug build of Qt, although it appends "d.dll" to its dll's, it does not append "d" to its executables. So a debug build of Qt Designer, in the same Qt distribution as release, will overwrite the release build, thus preventing your plugins from loading! So always build debug first, then release.