2023-10-03 09:48:40 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-11-29 10:51:19 +00:00
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: imagesModel
|
|
|
|
}
|
|
|
|
|
|
|
|
Instantiator {
|
|
|
|
model: 20
|
|
|
|
|
|
|
|
delegate: Rectangle {
|
|
|
|
parent: root
|
|
|
|
|
|
|
|
width: 150
|
|
|
|
height: 150
|
|
|
|
|
|
|
|
color: 'whitesmoke'
|
|
|
|
border.width: 1
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
Label {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "image " + index
|
|
|
|
font.pixelSize: 20
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: keepUrlAlive
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
imagesModel.append({
|
|
|
|
imageLink: "",
|
|
|
|
rawLink: `raw link ${index}`
|
|
|
|
})
|
|
|
|
|
|
|
|
Qt.callLater(grabToImage, imageResult => {
|
|
|
|
keepUrlAlive.source = imageResult.url
|
|
|
|
imagesModel.setProperty(index, "imageLink",
|
|
|
|
Qt.resolvedUrl(imageResult.url))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-03 09:48:40 +00:00
|
|
|
ImagesGridView {
|
|
|
|
id: grid
|
2022-11-29 10:51:19 +00:00
|
|
|
|
2023-10-03 09:48:40 +00:00
|
|
|
anchors.fill: parent
|
2022-11-29 10:51:19 +00:00
|
|
|
|
2023-10-03 09:48:40 +00:00
|
|
|
clip: true
|
|
|
|
model: imagesModel
|
2022-11-29 10:51:19 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Components
|