"Module "QtQuick" version 2.3 is not installed"



  • I have searched thru Google and searched these forums, with no success.

    Just getting started on Qt and QtQuick. Installed qt-creator version 3.5.1 based on Qt 5.5.1. This is the one that my distro (CentOS 7) installs by default and is the only one listed as available in yum.

    I started the sample "Hello World" application that is loaded as a default when a QtQuick application is started.

    My main.qml is:

    import QtQuick 2.3
    import QtQuick.Window 2.2

    Window {
    visible: true
    MouseArea {
    anchors.fill: parent
    onClicked: {
    Qt.quit();
    }
    }

    Text {
    text: qsTr("Hello World")
    anchors.centerIn: parent
    }
    }

    I can't seem to get it to run with the "Run" icon in Qt Creator, so I just ran it from the command line with

    qmlviewer main.qml

    I get:

    Qml debugging is enabled. Only use this in a safe environment!
    file:///home/eric/Qt/HelloWorld/main.qml:1:1: module "QtQuick" version 2.3 is not installed

    When I installed Qt Creator, clearly something didn't install, but I've gone thru the install steps and don't see anything I might have missed.

    Any idea what's going on?

    How do I find the version of QtQuick (if any) that actually is installed? I've read that you can "import" a version that's earlier than the one installed and it will fall back to that earlier version. So, I tried 2.0, 2.1, 2.2 but no joy.

    Thanks...

    Eric


  • Lifetime Qt Champion

    Hi,

    Maybe a silly question but: did you install the Qt development packages from your distribution ?



  • @SGaist >> did you install the Qt development packages from your distribution ?

    Good evening, SGaist.

    Not a silly question at all. I basically became root and said "yum install qt-creator" and it installed whatever it was set up to install. Yum has been pretty good (although not perfect) in the past about installing everything that's needed and resolving dependencies. I got Qt Creator and Qt Designer and enough other stuff so that almost all that's available in Qt Creator works, except (apparently) Qt Quick.

    Was there something else I should have done to install the Qt development packages?

    If there was, I haven't been able to find a reference to it in the documentation or in Google.


  • Lifetime Qt Champion

    Check that you have also the QtDeclarative module installed. You should be able to check what is available with yum whatprovides "*/qt5"



  • I said "yum info qt5-qtdeclarative" and got:

    Installed Packages
    Name : qt5-qtdeclarative
    Arch : x86_64
    Version : 5.5.1
    Release : 2.el6
    Size : 9.6 M
    Repo : installed
    From repo : epel
    Summary : Qt5 - QtDeclarative component
    URL : http://www.qt.io
    License : LGPLv2 with exceptions or GPLv3 with exceptions
    Description : Qt5 - QtDeclarative component.

    Available Packages
    Name : qt5-qtdeclarative
    Arch : i686
    Version : 5.5.1
    Release : 2.el6
    Size : 4.1 M
    Repo : epel
    Summary : Qt5 - QtDeclarative component
    URL : http://www.qt.io
    License : LGPLv2 with exceptions or GPLv3 with exceptions
    Description : Qt5 - QtDeclarative component.

    Then I said "yum whatprovides "*/qt5"" and got

    qt5-qtbase-5.5.1-11.el6.i686 : Qt5 - QtBase components
    Repo : epel
    Matched from:
    Filename : /usr/share/doc/qt5
    Filename : /usr/share/qt5
    Filename : /usr/lib/qt5

    qt5-qtbase-devel-5.5.1-11.el6.x86_64 : Development files for qt5-qtbase
    Repo : epel
    Matched from:
    Filename : /usr/include/qt5

    qt5-qtbase-5.5.1-11.el6.x86_64 : Qt5 - QtBase components
    Repo : epel
    Matched from:
    Filename : /usr/lib64/qt5
    Filename : /usr/share/doc/qt5
    Filename : /usr/share/qt5

    qt5-qtbase-devel-5.5.1-11.el6.i686 : Development files for qt5-qtbase
    Repo : epel
    Matched from:
    Filename : /usr/include/qt5


  • Lifetime Qt Champion

    You need to install qt5-qtdeclarative-devel. For that matter install all devel packages for Qt 5 you'll be ready for the future ;)



  • That did it. Thank you, SGaist.

    I am still unable to start the Qt Quick "Hello World" app by clicking on the green triangle at the lower left of the Qt Creator screen, but I can start it with Tools->External->Qt Quick->... (qmlscene) which I couldn't do before.

    There certainly is a LOT (!!!) of devel stuff that doesn't get installed by default. Where is the best place to go where this level of detail in Qt installations is discussed clearly? Obviously I haven't found the best source of Qt docs yet.

    Thanks...

    Eric


  • Lifetime Qt Champion

    You can take a look at Qt's own documentation to have an overview of the modules available. As for what to install exactly, it depends greatly on the package manager of your distribution. There might be a "qt-5-devel" package somewhere that will pull in all the dependencies needed, but it's something you have to check with yum.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.