Unsolved Add c++ model to qml
-
Hi,
I create c++ model as library and I want to add it to my qml app.
I have following project structure:A/ CMakeLists.txt - mylib/ - CMakeLists.txt - - model/ - - CMakeLists.txt - app/ - CMakeLists.txt - main.qml
So I want to import class from model (A/mylib/model) to main.qml. I try use:
qt6_add_qml_module(model URI mylib.model VERSION 1.0 SOURCES someclass.h someclass.cc )
In CMakeLists.txt in model dir.
And I import this to main.qml:import mylib.model
But when I start problem I receive:
module "mylib.model" is not installed
How should I adopt my cmake files to work with this model in main.qml?