C
ImageFiles.MCU.base
Defines the base path for the assets.
Description
The base path determines the anchor for the computed resource URIs. When using the resources defined using the "files" or "directory" properties, the base name is omitted from the path as shown in the following example.
Usage
This property is accepted in the main application .qmlproject file, or a module .qmlproject file. It takes a string.
Code example:
# In myproject.qmlproject file
ImageFiles {
// Specify the base image paths declared in the current node
MCU.base: "images"
files: ["images/small/foo.png", "pics/small/bar.png"]
}
# In CustomItem.qml
Image {
id: image1
source: "/small/foo.png" // The base "images" is not included in the source path
}
Image {
id: image2
source: "/pics/small/bar.png" // image2 is not in images, "base" has not effect
}Since
This property was introduced in QmlProject API 1.3 .
Available under certain Qt licenses.
Find out more.