diff --git a/src/lib/plugin/kpluginloader.cpp b/src/lib/plugin/kpluginloader.cpp --- a/src/lib/plugin/kpluginloader.cpp +++ b/src/lib/plugin/kpluginloader.cpp @@ -243,8 +243,12 @@ if (QDir::isAbsolutePath(directory)) { dirsToCheck << directory; } else { - const QStringList listPaths = QCoreApplication::libraryPaths(); - for (const QString &libDir : listPaths) { + QStringList listPaths = QCoreApplication::libraryPaths(); + // Force applicationDirPath at first position. This way + // Plugins may be loaded from cmake build directories so long as they + // are in suitable subdirectories of the bin/ folder. + listPaths.prepend(QCoreApplication::applicationDirPath()); + for (const QString &libDir : qAsConst(listPaths)) { dirsToCheck << libDir + QLatin1Char('/') + directory; } }