QML Quick Controls compile error
Whenever I try to run my QT desktop application using a qml file that imports
import QtQuick.Controls 1.0
I get the following error: main.qml:2:1: module "QtQuick.Controls" is not installed
I am using QT5.1 for Android (Windows 32bit). Do I need to get the QtQuick Controls separately? My impression is that they are included in the QT5.1 SDK I downloaded.
Any help would be greatly appreciated.
Controls are integrated into Qt 5.1, they should work for you.
Do I have to link to a special library to have QtQuick Controls 1.0, or should QtCreator find it by himself?
It should all work out of the box. I have not tested it on Android, maybe Controls are not fully supported there yet.
Thanks sierdzio for your effort to help me so far.
Obviously I am doing something wrong. I tried it now with two versions of Qt5.1 namely:
Qt 5.1.0 for Android (Windows 32-bit, 716 MB)
Qt 5.1.0 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB)
I only installed them with the included installer and started the included QtCreator. With both I run into the problem that I get the error message about importing QtQuick.Controls . I also tried the separate QtCreator 2.8.0 which didn't change anything in the behaviour. I wondered whether QtCreator was not able to find the Dlls in <qtdir>/qml/QtQuick/controls. So I tried to put those into the plugins directory of QtCreator with no success. I am also wondering whether the QtQuick.Controls should show up in the QtCreator-Dialog found in Help->Plugins?
Even more strange it is that when hovering over the import line in the qml file, the tooltip shows the correct path to the controls and says "typeinfo read".Obviously only the runtime part of the controls is missing.
Currently I have absolutely no clue how to get that qml QtQuick.Controls stuff running. Maybe anyone here has an idea or hint, which would be greatly appreciated.
OK that clears things up, although I still won't have a definite answer for you, sorry ;)
Qt Creator is just an IDE, the Qt application you write, compile and run is totally independent: sometimes QtC will report errors in the text editor, but the actual application works without problems. In this case, however, Controls work fine for me, both inside QtCreator and in the application. I am on Linux, so again I can't say anything with certainty for Windows (but the thing was tested before release, so it should work, right? :D).
About->Plugins pane is all about plugins for Qt Creator (version control support, additional modules like Python editor etc.), it has nothing to do with Qt itself or QML plugins.
Apologies again, but I don't know why you are getting this problem. Are other QML components working OK for you (Item, Rectangle, NumberAnimation, etc.)?
Thanks again sierdzio.
Got an hint from someone else saying that QtQuick.Controls requires QtQuick 2.1 (also found that confirmed at the following link,
however currrently I use QtQuick 1.1 in my QML file. I didn't test it yet, but this might be the problem.
Of course. Controls are based on Scenegraph and require QtQuick 2 (and Qt5).