Skip to content

Add sopport natie deploy of automaticly generated QML plugins [Qt6] #847

@EndrII

Description

@EndrII

Currently, CQtDeployer can't automatically deploy auto-generated qml plugins of custom libraries.

Current solution - Use the NO_PLUGIN option to create library and manually invoke the initialize method
see:

set(CURRENT_PROJECT cool_project)
qt_add_qml_module(${CURRENT_PROJECT}
    URI ${CURRENT_PROJECT}
    VERSION 1.0
    QML_FILES  ${MODULE_QML_FILES}
    RESOURCES ${SOURCE_ASSETS}
    SOURCES  ${SOURCE_CPP}
    NO_PLUGIN # here is important option to successful deploy your app.
)

Next:
You need manual call initialization function. qml_register_types_${CURRENT_PROJECT} in your initialization C++ code.

extern void qml_register_types_cool_project();

void init() {
    qml_register_types_cool_project();
}

See Qt official documentation

Metadata

Metadata

Assignees

Labels

EnhancementNew feature or requestLinuxLinux versionWindowsWindows version

Type

No fields configured for Task.

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions