Skip to content

Example Request: An example with more than one .qml file #296

@andrew-otiv

Description

@andrew-otiv

None of the current examples currently show how to load more than one qml file, i.e. so additional types and forms can be declared in qml forms:

(base) andrew-otiv@evo:~/src/qmetaobject-rs$ find . -name "*.qml"
./qmetaobject/tests/qml/main.qml
./qmetaobject/tests/qml/Bar.qml
./examples/todos/main.qml
./examples/webengine/main.qml
./examples/graph/src/main.qml

I have tried many combinations of QmlEngine::load_file, QmlEngine::load_data, QmlEngine::load_data_as, and with data embedded using the qrc! macro, rust's standard include_bytes! macro.

If licensing doesn't get in the way, perhaps one of the main qt examples could be ported over to qmetaobject-rs? The coffee machine example in particular only contains about 10 lines of C++ boilerplate, and the rest is implemented in QML and shouldn't require porting.

Or perhaps the button layout in the todos example could be factored into a separate form? I will take a crack at that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions