Commit a420845c authored by Michael Winkelmann's avatar Michael Winkelmann

Asynchronous loading

parent 90887ed4
Pipeline #1223 failed with stages
......@@ -10,13 +10,33 @@ Window {
title: qsTr("Hello World")
ViewerContainer {
id: container
anchors.fill: parent
contentItem: Image {
id: contentItem
source: "qrc:///Photo.jpg"
//width: implicitWidth()/5
fillMode: Image.PreserveAspectFit
mipmap: true
Rectangle {
color: "red"
width: 32
height: 32
anchors.centerIn: parent
MouseArea {
anchors.fill: parent
onClicked: container.zoomToFit();
}
}
asynchronous: true
onStatusChanged: {
if (status === Image.Ready) {
container.zoomToFit();
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment