module "QtQuick.Dialogs" is not installed
-
Trying to use the ColorDialog in Qt 1.15.2 for iOS. Every time I run the qml project, I get the error message:
QQmlApplicationEngine failed to load component qrc:/main.qml:3:1: module "QtQuick.Dialogs" is not installed
The import looks like this:
import QtQuick.Dialogs 1.3
Tried with versions 1.0, 1.1, 1.2, 1.3, 1.4 and 1.5, but no matter what, it keeps saying the same thing. Tried looking in the installer, but could not find anything missing. Qt Creator does not display any error messages and even gives a list of minor versions to select from.
What am I doing wrong? Is there an alternative?
-
Sorry for the late reply,
In the example you provided the cause of the issue is that you have your actual QML code and it's import in a library instead of the app proper, this breaks qmake's import scanning. That's why there's an additional file in the actual app project (main) that does nothing but import all the modules that the library needs. Once you add "import QtQuick.Dialogs" in there the example will work.
If the subproject were a proper QML module I think this ought to work out of the box but the way this project is set up this is the only feasible way.
Also, you may want to remove the link to the source code since you may not be allowed to distribute the non-LGPL template parts of it.
Hope this helps.
-
Hello Colton,
It would be very helpful if you could provide some more details, especially the full source code including any CMake/QMake files used to build this project? These might cause the QtQuick.Dialogs module to not be deployed properly.
If you can reproduce it with any of Qt's builtin examples that would obviously be even better.
-
Was able to get the ColorDialog working with a new project. Created a minimal project that reproduces the 'module "QtQuick.Dialogs" is not installed' error (based on this template: https://marketplace.qt.io/products/qt-lgpl-app-template):
Did not occur to me that it would be a problem with the project structure, thank you for bringing it to my attention.
-
Sorry for the late reply,
In the example you provided the cause of the issue is that you have your actual QML code and it's import in a library instead of the app proper, this breaks qmake's import scanning. That's why there's an additional file in the actual app project (main) that does nothing but import all the modules that the library needs. Once you add "import QtQuick.Dialogs" in there the example will work.
If the subproject were a proper QML module I think this ought to work out of the box but the way this project is set up this is the only feasible way.
Also, you may want to remove the link to the source code since you may not be allowed to distribute the non-LGPL template parts of it.
Hope this helps.