Installing Qt 5.x on Ubuntu globally

32,753

That will probably cover it:

sudo apt-get install qtdeclarative5-dev qml-module-qtquick-controls
Share:
32,753
Ilya
Author by

Ilya

Software Engineer, CS student, Open Source enthusiast

Updated on September 18, 2022

Comments

  • Ilya
    Ilya over 1 year

    Hello everyone! :)

    I need to install Qt 5 globally on Ubuntu to be able to use QML libraries like Kirigami. However, the wast majority of Google search results tell how to install it locally (as a folder) from Qt's official website. How can I install Qt 5.x as a set of packages to get something functionally equivalent to Qt installation from qt.io?
    I use Ubuntu 16.04.1 on my x64 PC.

    Thanks in advance!

  • Ilya
    Ilya over 7 years
    I have previously installed some other Qt packages, so both ones you've mentions are already installed. However, when I try to launch a sample app ("Stickman"), it says "/home/ilya/stickman/graphicsview.h:44: error: QtWidgets/QGraphicsView: No such file or directory". Also, Qt from qt.io comes with lots of QML samples.
  • Velkan
    Velkan over 7 years
    QGraphicsView is in QtWidgets, so it's not useful when working with QtQuick.
  • Ilya
    Ilya over 7 years
    Oh, thanks :) I'll try working with QML and write back.
  • Ilya
    Ilya over 7 years
    Compiling a sample QML-Material application produces the following error message: /home/ilya/demo/main.cpp:1: error: QGuiApplication: No such file or directory
  • Velkan
    Velkan over 7 years
    It should be in /usr/include/x86_64-linux-gnu/qt5/QtGui/QGuiApplication. It's in qtbase5-dev package which is installed by qtdeclarative5-dev.
  • Ilya
    Ilya over 7 years
    The problem is that on compilation Qt uses headers for Qt 4, although Qt 5 is selected as default both in Qt Creator and systemwide. Now trying to solve.
  • Ilya
    Ilya over 7 years
    The problem was in "Desktop" configuration. Now solved and things seem to work poperly. Thanks so much for help :)