import QtQuick.Controls 2.1 QML MODULE NOT FOUND

15,649

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:
settings of qml emulatiln

Share:
15,649
kumar vinit
Author by

kumar vinit

Updated on June 26, 2022

Comments

  • kumar vinit
    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
    kumar vinit over 10 years
    Thanks for your time.Do i have to install Qt 5.1 now. What about Qt Creator version.
  • koopajah
    koopajah over 10 years
    You 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
    kumar vinit over 10 years
    I will give it a try.Thanks
  • Armaghast
    Armaghast over 10 years
    A 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
    CybeX about 4 years
    same, 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