I'm getting an error while trying to get Qt .qml environment working in CLion, cause I don't really want to use QtCreator:
QQmlApplicationEngine failed to load component
qrc:/main.qml:2:1: module "QtQuick.Window" is not installed
qrc:/main.qml:1:1: module "QtQuick" is not installed
qrc:/main.qml:2:1: module "QtQuick.Window" is not installed
qrc:/main.qml:1:1: module "QtQuick" is not installed
No idea what's going on, made a huge research and I haven't found anything. My QML file I'm trying to run is:
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
}
resources.qrc:
<RCC>
<qresource>
<file>main.qml</file>
</qresource>
</RCC>
CMakeLists.txt: https://gist.github.com/zmatez/52d7a552d10d82beed8d86783b1322eb
CMake options:
-DCMAKE_PREFIX_PATH="E:/ProgramFiles/qt/5.15.2/mingw81_64/lib/cmake/Qt5"
main.cpp: https://gist.github.com/zmatez/52d7a552d10d82beed8d86783b1322eb
I was comparing it with auto-generated code with QtCreator, and my is almost identical as the creator's one. Also, QtWidgets application was working fine in CLion on my current configuration.
Thanks for any help
QML2_IMPORT_PATH
ot whatever. The question actually doen't relate to QML but mostly to CLion. I guess there are lots of tutorials across the Internet. – folibis