C
ImageFiles.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ライセンスの下で利用可能です。
詳細はこちらをご覧ください。