Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.1
-
CentOS 7
-
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
- relates to
-
QTBUG-35754 QtQuick and QtQuick.Controls modules are not available at runtime static
- Closed
For Gerrit Dashboard: QTBUG-45868 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
150919,8 | Enable using the module in a statically built application | 5.7 | qt/qtquickcontrols | Status: MERGED | +2 | 0 |