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

[Solved]QQuick 2.0 not installed



  • I used qt 4.8.0 and when i import QtQuick 2.0 version it's tell me that :

    module "QtQuick" version 2.0 is not installed



  • please anyone help....


  • Moderators

    QtQuick 2.0 is available in Qt5, not 4.8.0. So, grab a copy of the alpha, or the newest state from gitorious, compile, and use happily :)



  • I install Qt5 and in my Qt creator when run examples everything go right but the code appear in error area (meaning like Viewport when I type it, it show under it red line and i can't find it in the completer)
    and the QtQuick 2.0 it say module "QtQuick" version 2.0 is not installed import QtQuick 2.0.
    (I install Qt5 in folder and Qt in anther folder)

    In advance thanx for help


  • Moderators

    I'm sorry but your English is a bit hard to understand. I will do some guess work - if I misunderstand, please ask again :)

    Qt Creator might have an outdated code model if it treats good code as an error. To update the model, go to Tools=>QML/JS=>Reset code model. It usually works well.

    I don't understand what you mean in the second part of your post. I think you might have run into problems because you are trying to run Qt4 code under Qt5. There are some (small) source-incompatible changes in Qt5, that you have to address. You can search the docs and wiki for more info, but just as a quick recap:

    • in .pro file, add quick module to QT variable
    • change all QtDeclarative into QtQuick in includes
    • change declarative class names (QDeclarativeView=>QQuickView)

    I think that is it. Given purely from memory, so I might got something wrong - in that case just consult the documentation.



  • thanks for reply and so sorry for my language and my project is Qt Quick UI and I didn't try to run Qt4 code under Qt5 I run Qt5 code in Qt Creator and it run but it show my code is error by the creator put red line under the code like when I type viewport {} it show under it red line why that and second how to add option to qmlviewer to make my enable to add opengl option.

    Thanx for reply and thanx for helping me...


  • Moderators

    I have never used the viewport element. If the trick with reseting the code model does not work, I don't have any other trick up my sleeve.

    According to "docs":http://qt-project.org/doc/qt-5.0/qml-viewport.html, you need to include both QtQuick 2.0 and Qt3D 1.0 (Qt3D is now an integral part of Qt).

    As for OpenGL, I have no idea. I would guess it's enabled by default for QtQuick 2, but I'm not 100% sure (I use Mesa, and it works for me).



  • and the image for the Qt creator!http://img823.imageshack.us/img823/8541/captureyw.png(error show)!


  • Moderators

    You have said you want to use QtQuick 2.0, but you are importing 1.0. Change that, resolve code conflicts that will occur, and come back :)



  • I don't use QtQuick 2.0 because it show me QtQuick 2.0 not install and the code above is work with no error just it show like what you see


  • Moderators

    Ah, ok I finally got it. I think there was some trick to make Qt Creator look for additional plugins, but I cant remember what it was. Ask Tobias Hunger, he will know (or search for posts he has made, there was a similar conversation with him recently).



  • In .pro file set qt5 import path
    Ex:
    QML_IMPORT_PATH =/opt/qt5/imports



  • Thanx all it solved :)



  • Arlkutl your suggestion helped ..
    thanks for the post ;)


Log in to reply