8

Getting this error while running my program. I searched the Internet to find QtQuick.Controls but couldn't get any resolution.
How can I install this?

Jino
  • 345
  • 1
  • 2
  • 16

5 Answers5

5

this command fixed my problem.

sudo apt -y install qml-module-qtquick-controls
Fatemeh Karimi
  • 914
  • 2
  • 16
  • 23
3

You're likely using an old version of Qt. The QtQuick.Controls module was introduced in Qt 5.1:

Gustavo Niemeyer
  • 22,007
  • 5
  • 57
  • 46
  • 1
    I have Qt 5.0.2, how can I upgrade it to Qt 5.1 from OS Ubuntu 13.10? – Jino Jan 30 '14 at 04:56
  • 2
    So that's the reason you're getting the error you've asked about. How to upgrade is a different question, which I suggest asking on Ask Ubuntu. – Gustavo Niemeyer Jan 30 '14 at 13:35
  • 1
    I have upgraded to Qt Creator 3.0.0 Based on Qt 5.2.0 (GCC 4.6.1, 32 bit) Built on Dec 10 2013 at 11:47:52... still the same error.. please help! – Jino Jan 31 '14 at 09:27
1

Another cause of this 'module "Qt*" is not installed' class of problems on Ubuntu at least is the environment variable LD_LIBRARY_PATH not being set. It should include the path to the lib directory of your Qt installation, e.g.

if [ "x$LD_LIBRARY_PATH" = "x" ]; then
    export LD_LIBRARY_PATH=/home/username/Qt5.4.1/5.4/gcc_64/lib
else
    export LD_LIBRARY_PATH=/home/username/Qt5.4.1/5.4/gcc_64/lib:$LD_LIBRARY_PATH
fi
0

Here is another answer which covers my case since it's different from what the other two answers give as feedback.

I've built Qt 5.7 for the Raspberry Pi (Raspbian Jessie). From my notebook I transferred a simplistic QML-based project which worked there. However after building the project on my Pi and starting it (note that QML problems often don't show up when you compile and link stuff) I got that very same error. Obviously the version here was not an issue.

The problem was that for some reason I haven't built the qtquickcontrols and qtquickcontrols2 modules in the source tree of my Qt. Luckily I used an USB flash drive for storing the sources and also where I have build my Qt version from these so it was just a matter of cding inside the respective module directories, executing qmake followed by make -j4 (for faster building use parallel make) and finally make install.

rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
0

For those getting this issue while static building with vcpkg and CMAKE, I followed these steps:

  1. .\vcpkg install qt5-quickcontrols:<target>

I was building statically on a x64 windows platform so my target was x64-windows-static, more info about the target flag here

  1. In my CMakeLists.txt, below target_link_libraries() I added:

qt5_import_qml_plugins(${PROJECT_NAME} INCLUDE Qt5::qtquickcontrolsplugin)

Crystal
  • 65
  • 1
  • 6