C

Qt Quick Ultralite 文件加载示例

import QmlProject 1.3

Project {
    mainFile: "fileloading.qml"

    MCU.Config {
        maxResourceCacheSize: 100000
    }

    ImageFiles {
        files: [ "2007.png" ]
        MCU.prefix: "logos"
        MCU.resourceAsFile: false // To check internal resource
    }

    ImageFiles {
        files: [ "2008.png" ]
        MCU.prefix: "logos"
        MCU.resourceAsFile: true
        MCU.resourceCompression: false
    }

    ImageFiles {
        files: [ "2015.png" ]
        MCU.prefix: "logos"
        MCU.resourceAsFile: true
        MCU.resourceCompression: true // PNG compression
        MCU.resourceCachePolicy: "OnDemand"
    }

    ImageFiles {
        files: [ "2016.png" ]
        MCU.prefix: "logos"
        MCU.resourceAsFile: true
        MCU.resourceImagePixelFormat: "ARGB8888RLE"
        MCU.resourceCachePolicy: "OnDemand"
    }
}