Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot choose QtQuick version in Ubuntu



  • I have installed qt in Ubuntu. Here are some details about the Ubuntu and QT installation:

    $ lsb_release  -a
    LSB Version:	core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
    Distributor ID:	Ubuntu
    Description:	Ubuntu 18.04.6 LTS
    Release:	18.04
    Codename:	bionic
    
    $ aptitude versions qml-module-qtquick2
    Package qml-module-qtquick2:                              
    p   5.9.5-0ubuntu1                                              bionic                                   500 
    i   5.9.5-0ubuntu1.1                                            bionic-updates                           500 
    
    Package qml-module-qtquick2:i386:
    p   5.9.5-0ubuntu1                                              bionic                                   500 
    p   5.9.5-0ubuntu1.1                                            bionic-updates                           500
    
    $ qmake --version
    QMake version 3.1
    Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
    

    I am building the application successfully, without any error or warning, from terminal command line:

    $ qmake
    $ make
    

    In this application, I need the QtQuick version 2.15. However, if I import it in the main.qml...

    import QtQuick 2.15
    

    ... I get this runtime error when I start the application:

    09:30:29,030 Warning: QQmlApplicationEngine failed to load component
    09:30:32,164 Warning: qrc:/main.qml:1 module "QtQuick" version 2.15 is not installed
    

    I can start it only if I import lower QtQuick versions (e.g. 2.9).

    Note 1: in the same machine, I have also installed Qt using the installer qt-unified-linux-x64-4.1.1-online.run downloaded from https://www.qt.io/download. If I build the same application and run it with the debugger, with the GUI of qtcreator, I don't have this problem: the QtQuick 2.15 is successfully imported.

    Note2: when I install the qtquick...

    sudo apt-get install qml-module-qtquick-controls2
    

    It installs the version 5.9.5, which doesn't include the QtQuick 2.15.

    What should I do to install properly the qt library, in order that I can import the QtQuick 2.15 in the main.qml when starting the program with the command line?

    How can I force the "apt-get install" to install a newer version than 5.9.5?


Log in to reply