1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (C) 2026 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only
//! This module contains functions for importing artifacts from the
//! [Qt Resource System](https://doc.qt.io/qt-6/resources.html).
//!
//! All artifacts must be compiled into dynamic resources with the
//! [`rcc` tool](https://doc.qt.io/qt-6/rcc.html):
//! ```bash, ignore
//! 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.
//! ```xml, ignore
//! <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:
//! ```qml, ignore
//! 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.
/// Registers Qt resource data from an in-memory byte slice, making embedded
/// resources available at runtime through the `qrc:/` scheme.
///
/// Returns `true` if registration succeeded, `false` otherwise.
/// Registers Qt resource data from an in-memory byte slice under `resource_root`,
/// making embedded resources available at runtime through the `qrc:/` scheme.
///
/// Returns `true` if registration succeeded, `false` otherwise.