Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45868

"QtQuick.PrivateWidgets" plugin "widgetsplugin" not found on static Qt builds using qml MessageDialog

    XMLWordPrintable

Details

    • b4c13916ec0fd7796acdf0ec5a1db0134479b3f2

    Description

      Here's about the simplest sample code I can think of to recreate this issue:

      sampleqml.qml

      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Dialogs 1.1
      
      ApplicationWindow {
          MessageDialog {
              id: errorDialog
              title: qsTr("Sample Message Dialog")
              onAccepted: Qt.quit()
          }
      }
      

      main.cpp

      #include <QApplication>
      #include <QQmlApplicationEngine>
      #include <QtQml>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          // Initialize QML
          QQmlApplicationEngine engine(QUrl(QStringLiteral("qrc:/sampleqml.qml")));
          return app.exec();
      }
      

      When I try to run this application, I get this error:
      QQmlApplicationEngine failed to load component
      qrc:/sampleqml.qml:6 Type MessageDialog unavailable
      qrc:/QtQuick/Dialogs/WidgetMessageDialog.qml:42 module "QtQuick.PrivateWidgets" plugin "widgetsplugin" not found

      This ONLY happens when I compile it against a statically built Qt. My qtquickcontrols module IS installed (as far as I can tell...). I've even tried to make it specifically using "make module-qtquickcontrols".

      Here's a list of my Qml libs in my installed lib directory (I'm pretty sure I have them all, but here's a few just to rule that possibility out):

      libQt5QuickParticles.a
      libQt5QuickParticles.la
      libQt5QuickParticles.prl
      libQt5Quick.prl
      libQt5QuickTest.a
      libQt5QuickTest.la
      libQt5QuickTest.prl
      libQt5QuickWidgets.a
      libQt5Widgets.a
      libQt5QuickWidgets.la
      libQt5Widgets.la
      libQt5QuickWidgets.prl
      libQt5Qml.a
      libQt5QmlDevTools.a
      libQt5QmlDevTools.la
      libQt5QmlDevTools.prl
      libQt5Qml.la
      libQt5Qml.prl
      libQt5Quick.a
      libQt5Quick.la
      

      My workaround is to... simply not use MessageDialog at all. All my other QML items appear to work (I haven't tried EVERY Qt Quick Controls item, but I have used quite a bit of QML, and this was the only error spot).

      The other workaround is to build Qt as a shared library.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              andysh Andy Shaw
              atemple03 Adam Temple
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes