QML module not found 해결법

2021. 12. 20. 00:01Programming/Qt

반응형

qt를 cmake로 빌드파일을 만들 때 사용자 모듈을 인식하지 못하는 오류가 생긴다.

해결법은 다음 stackoverflow에서 찾았다. 

https://stackoverflow.com/questions/56347507/custom-qml-module-not-found

 

Custom QML module not found

I have a QML application. I have created my own QML module. called MyCustomModule. The module has the appropriate qmldir file, which is registered to the corresponding my_custom_module.qrc file. I ...

stackoverflow.com

# Make Qt Creator aware of where the QML modules live
set (_QML_IMPORT_PATHS "")

## Add new module paths here.
list (APPEND _QML_IMPORT_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/imports/)

set (
    QML_IMPORT_PATH
    ${_QML_IMPORT_PATHS}
    CACHE
    STRING
    "Path used to locate CMake modules by Qt Creator"
    FORCE
)

위의 오류는 QT Creater 오류로 QML_IMPORT_PATH를 따로 추가해줘야 한다.

반응형

'Programming > Qt' 카테고리의 다른 글

qml ChartView zoom in rect  (0) 2022.03.08
Unable to assign QQuickRootItem to double  (0) 2021.07.31
QQuickView does not support using a window as a root item.  (0) 2021.07.24
Error while building/deploying project  (0) 2021.07.22
Qt Quick이란?  (0) 2021.07.21