このページでは

C

イメージファイル.MCU.prefix

画像アセットのURIに共通のプレフィックスを追加します。

説明

prefix ノードは、アセットへのアクセスに使用される URI に共通のプレフィックスを追加します。

使用方法

このプロパティは、メインアプリケーション.qmlproject ファイルまたはモジュール.qmlproject ファイルで使用できます。文字列を指定します。

コード例

# In myproject.qmlproject file
ImageFiles {
    // Specify the prefix for images declared within the current node
    MCU.prefix: "assets"
    files: ["map/small.png"]
}

# In CustomItem.qml
Image {
    id: image
    source: "/assets/map/small.png"
}

プロパティbase は、prefix と組み合わせて使用できます。

注: base が見つからない場合でも、prefix は URI に追加されます。

# In myproject.qmlproject file
ImageFiles {
    // Specify the prefix for images declared within the current node
    MCU.base: "photos"
    MCU.prefix: "pictures"

    files: ["photos/hires/house.png", "map/small.png"]
}

Image {
    id: image1
    source: "/pictures/hires/house.png"
}

Image {
    id: image2
    source: "/pictures/map/small.png"
}

このプロパティは

このプロパティは QmlProject API 1.3 で導入されました。


Qt ライセンスの下で利用可能です。