QML module not found (QtQuick and content)
-
Hi Everyone,
I've successfully installed Qt version 6.4.2 on my Linux Kubuntu23 6.5.0-9-generic and compiled Qt Creator 13.0.0-beta1 (12.0.82). I've created a new Qt Quick Application which is currently empy expect the default generated files.
The Qt Creator is complaining about QML module not found (QtQuick and content)
I've searched around this forum but it looks like there is no solution for this issue. The path is correct as far as I can say....
What can I do?
Thanks Fred -
Hi and welcome to devnet,
Based on the error message, you installed your distribution provided Qt. Did you install all the development packages ?
-
This post is deleted!
-
@SGaist Thanks! The development packages were missing, so I'm now one step further. I've still the issue with 'content', which is a folder from my test project....In App.qml of content subfolder is the import of the testApp is also failing. I've added the current project folder with QML_IMPORT_PATH to the project settings but without luck. What I'm missing here?
-
Based on what I have read recently, it's highly recommended to move to CMake for QML based projects. Qt 6 has brought new improvements and features that are not supported by qmake.
-
Can you show the content of the
CMakeLists.txt
file you got ? -
@SGaist Sure
cmake_minimum_required(VERSION 3.21.1) option(LINK_INSIGHT "Link Qt Insight Tracker library" ON) option(BUILD_QDS_COMPONENTS "Build design studio components" ON) project(testAppApp LANGUAGES CXX) set(CMAKE_AUTOMOC ON) find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Qml Quick) if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3) qt_standard_project_setup() endif() qt_add_executable(testAppApp src/main.cpp src/theorb.h src/theorb.cpp) qt_add_resources(testAppApp "configuration" PREFIX "/" FILES qtquickcontrols2.conf ) target_link_libraries(testAppApp PRIVATE Qt6::Core Qt6::Gui Qt6::Qml Qt6::Quick ) if (BUILD_QDS_COMPONENTS) include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents) endif() include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules) if (LINK_INSIGHT) include(${CMAKE_CURRENT_SOURCE_DIR}/insight) endif () include(GNUInstallDirs) install(TARGETS testAppApp BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
-
Is it a project generated by Qt Creator ?