Module qresource

Module qresource 

Source
Expand description

This module contains functions to import of artifacts the Qt Resource System.

All artifacts must be compiled into dynamic resources with the rcc tool:

rcc -binary [more options] <inputs>

before or at compile time. The input for the rcc tool are Qt Resource Collection (*.qrc) files, that contain lists of all files to be imported.

<RCC>
    <qresource prefix="/">
        <file>images/copy.png</file>
        <file>images/cut.png</file>
        ...
    </qresource>
</RCC>

Dynamic resources can be registered with register_bytes and are then available at runtime through the qrc:/ scheme in QML:

Image {
    source: "qrc:/images/copy.png"
}

We further provide the [include_bytes_qml] macro that generates the required dynamic resource directly in Rust at compile time.

Functionsยง

register_bytes
Registers Qt resource data from an in-memory byte slice.
register_bytes_with_prefix
Registers Qt resource data from an in-memory byte slice with a prefix.