import QtQuick.Controls 2.1 QML MODULE NOT FOUND
Solution 1
The module QtQuick.Controls
has been added on Qt 5.1
and is currently at the 1.0
version. It also requires you having QtQuick
version 2.0, introduced with Qt 5
So if you want to use TableView
you would have to update your current Qt
version to at least 5.1 and then use these import
statement:
import QtQuick 2.0
import QtQuick.Controls 1.0
Also, as indicated by Armaghast in the comment, if you are moving to the latest Qt version (currently Qt 5.2.1) you should use
import QtQuick 2.2
import QtQuick.Controls 1.1
Solution 2
In my case running qmake
fixed issue.
Update 2020 (new way):
In some cases it not helped. Instead this solution helped greatly.
In the QtCreator, open settings/preferences and go to QtQuick > QtQuick Designer and select Use QML emulation layer...
option in Qml Emulation Layer section and get your most newer version of Qt to it as follow:
kumar vinit
Updated on June 26, 2022Comments
-
kumar vinit about 2 years
I am using Qt Creator 2.4.1 base on Qt 4.7.4(32 bit) on windows. I have to create a table in QML using Table View. When i try import QtQuick.Controls 2.1 i get the error QML MODULE NOT FOUND. Same error on Qt Creator 2.6.2 based on Qt 5.0.1. Any help appreciated.
-
kumar vinit over 10 yearsThanks for your time.Do i have to install Qt 5.1 now. What about Qt Creator version.
-
koopajah over 10 yearsYou should install Qt5.1 and use the Qt Creator that is bundled with the version you downloaded. If you can it would be even better to move to the latest official Qt release, currently Qt 5.2.1
-
kumar vinit over 10 yearsI will give it a try.Thanks
-
Armaghast over 10 yearsA small addition: with Qt 5.2, QtQuick.Controls' version is 1.1, and QtQuick one is 2.2, small additions and different implementations are the main change I think.
-
CybeX about 4 yearssame, I clicked on the hammer (build) icon and it resolved the missing module. I have a standard Windows Qt 5.13.1 install with Qt Creator 4.10.0