“module QtQuick.Controls is not installed” error On Ubuntu 14.04

George Sofianos picture George Sofianos · Mar 13, 2014 · Viewed 18.2k times · Source

I installed the latest Ubuntu SDK and tried to use Qt Quick Controls but they were unavailable. Then I installed Qt 5.2.1 from here https://qt-project.org/downloads and created a new project with the Qt Quick Controls option selected. when I tried to build & run the application the following message appeared in output:

Starting /usr/lib/x86_64-linux-gnu/qt5/bin/qmlscene...
file:///home/george/Projects/untitled/untitled.qml:2 module "QtQuick.Controls" is not installed

I tried uninstalling Ubuntu SDK And Qt and then re installing only Qt from the official site with no success. Neither Qt Creator or qmlscene seem to find the module.

The answer of this question (https://askubuntu.com/questions/368507/are-qt-quick-controls-available-on-ubuntu-13-10) says that " Trusty Tahr will likely have Qt 5.1 or Qt 5.2 in its repositories." and that official qt project package should work.

Am I doing something wrong ? May this be a bug of Qt Installer ?

Answer

George Sofianos picture George Sofianos · Mar 14, 2014

Ok I found which is the problem and I'm posting the solution as well:

There is a QT5 installation at :

/usr/lib/x86_64-linux-gnu/qt5/ (version 5.0.2)

This installation may be a part of ubuntu SDK or is build-in in Ubuntu 14.04.

Our Installation is usually at home folder. For me it was at :

~/Qt5.2.1/5.2.1/gcc_64/

The problem is that when I start a project at QtCreator it searches the first path for qml modules and other files instead of my installation.

How to fix it:

  • On the top menu select Tools->Options.
  • Select Build & Run and then select the Qt Version tab on the right
  • There should be 2 entries here. One under auto detect and one under Manual. Keep only the one that its qmake path is from your qt installation instead of the one inside /usr/lib... I kept the auto detect one.
  • Apply and now QtCreator should work.

These are my settings after the fix: Qt Creator Setting After The Fix