"import QtQuick.Controls 1.0" - QML Module not found (Design Time only - intellisense)

  • Platform: Windows(VS2012) and OSX
    Built from: Qt Installer
    Version: 5.1

    Now if I create a new QML project from QtCreator, everything works fine(intellisense wise).

    However if I generate the project via importing CMakeLists.txt (CMake generator) file, the application runs and functions fine however while editing the qml file there is no intellisense support for most of the file.


    Pls note the application itself compiles and run's fine. It's just the design time complains about not finding the module and thus the Design tab is completely un-usable making it quite annoying to work with.

    Finally it also seems to pick up the QtQuick 2.1 line fine, it's just the other one's it's complaining about. Not really sure where or how to try adding this "QML_IMPORT_PATH" vis CMake since it seems to a design time only problem and build/run-time seems to locate all requirements correctly

  • Moderators

    CMake support is AFAIK experimental. Maybe it's a good idea to report this in Qt "bugtracker":http://bugreports.qt-project.org/ (but first search if it's not already reported).

  • Yeh that was kinda what I'd thought. Currently my workaround for this to get CMake generate a .pro file.

    As long as I had the .pro file with contents such as:

    @ set(QtPROHelper ${CMAKE_BINARY_DIR}/something.pro)
    file(WRITE ${QtPROHelper} "#This File is Auto-Generated. Do Not Edit Manually.")
    file(APPEND ${QtPROHelper} "\nQT += qml quick widgets")
    file(APPEND ${QtPROHelper} "\nTARGET = something")
    file(APPEND ${QtPROHelper} "\n\nRESOURCES += $$quote(${CMAKE_SRC_DIR}/resources.qrc)")
    file(APPEND ${QtPROHelper} "\n\nOTHER_FILES += ")
    foreach(VIEW_FILE ${VIEW_FILES})
    file(APPEND ${QtPROHelper} "$$quote(${VIEW_FILE}) ")

    With just that I can open the project via the .pro when I need to work on the QML side of things and intellisense works fine. When I need to actually build the project/ work on the c++ side I just flip back to VisualStudio.

    You could ofc go all out and add the LIBS and INCLUDEDIR and such to get the .pro to compile as well but it wasn't needed.

Log in to reply

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