Important: Please read the Qt Code of Conduct -

Fail to run statically compiled executable - plugin "qtquickcontrolsplugin" not found

  • Hello,
    Running into a little problem when trying to launch a program built with a statically compiled version of 5.12.1.
    To be clear, the compilation itself is running fine and running the program when built with a "dynamic" kit, either inside QtCreator or launching the executable, is also working fine. The problem I'm experiencing is exactly the same on Windows 10 and Linux (Debian 9).
    Also note that it used to work, but unfortunately I haven't tested the static build regularly so I'm not sure what introduced the problem.
    To get to the point, when launching the static version of the program, either from QtCreator or the executable, I get:

    QQmlApplicationEngine failed to load component
    qrc:/views/MainView.qml:31 Type MessageDialog unavailable
    qrc:/ Type Button unavailable
    file::/ module ":.qt-project.imports.QtQuick.Controls" plugin "qtquickcontrolsplugin" not found

    Which seem to lead to a reference / import problem for QtQuick.
    The content of the file in question (on my Linux install: /opt/Qt/5.12.1_static/qml/QtQuick/Controls) is:

    module QtQuick.Controls
    plugin qtquickcontrolsplugin
    classname QtQuickControls1Plugin
    typeinfo plugins.qmltypes
    depends QtQuick.Window 2.2
    depends QtQuick.Layouts 1.0

    And I see that DefaultMessageDialog.qml from the Qt source is importing QtQuick.Controls 1.2 as well as QtQuick.Controls.Private 1.0

    Any idea where it could come from? Am I'm not linking something correctly? A QML import in the pro file maybe (not )?
    Thank you!

  • Completing with further testing:
    I realized the MessageDialog in question, from the error message, was unjustly associated with the Qt.labs.platform plugin although my import was QtQuick.Dialog 1.12. (Pressing F1 sent me to the documentation for labs.platform). Which would explain some inner component was not found?
    I used the platform plugin somewhere else in my code, does this explain that it's trying to use it elsewhere instead of the Dialog plugin?
    [Doesn't seem so, I replaced it everywhere and I get the same problem.]

    Anyway, changing my import to Qt.labs.platform 1.0 and adapting my MessageDialog, I now get:

    QQmlApplicationEngine failed to load component
    qrc:/views/MainView.qml:4 module "Qt.labs.platform" plugin "qtlabsplatformplugin" not found

    Which doesn't help me much, I guess the problem is the same only now it's looking for something else.
    Thanks for your help,

  • Me again...
    Took the opposite approach and replaced Qt.Dialogs everywhere with Qt.labs.platform.
    The application now runs, but whenever I try to open a MessageDialog, it complaints:

    ERROR: No native MessageDialog implementation available.
    Qt Labs Platform requires Qt Widgets on this setup.
    Add 'QT += widgets' to .pro nd create a QApplication in main().

    (FileDialog and FolderDialog are OK...)
    So, it's pretty explicit, but I don't want to do that, I'd like to understand why it's not working anymore with regular QML dialogs from Qt.Dialogs.
    Why is the labs module reachable but not the Dialogs one?

Log in to reply