There is an example of using QML_ELEMENT
in qt5\qtdeclarative\examples\quick\scenegraph\openglunderqml
and qt_add_qml_module
in CMake
:
qt_add_qml_module(openglunderqml
URI OpenGLUnderQML
VERSION 1.0
QML_FILES main.qml
RESOURCE_PREFIX /scenegraph/openglunderqml
NO_RESOURCE_TARGET_PATH
)
In QML
it imports the module:
import OpenGLUnderQML 1.0