mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] dispatch thumbnail creation signal from grid
This commit is contained in:
parent
60c8e779d5
commit
af2c9c0fd3
2 changed files with 19 additions and 10 deletions
|
@ -31,17 +31,13 @@ Item {
|
||||||
property var metadata: metadataStr ? JSON.parse(viewpoint.get("metadata").value) : {}
|
property var metadata: metadataStr ? JSON.parse(viewpoint.get("metadata").value) : {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update thumbnail location
|
||||||
|
// can be called from the GridView when a new thumbnail has been written on disk
|
||||||
|
function updateThumbnail() {
|
||||||
|
thumbnail.source = ThumbnailCache.thumbnail(root.source);
|
||||||
|
}
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
thumbnail.source = ThumbnailCache.thumbnail(root.source)
|
updateThumbnail();
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: ThumbnailCache
|
|
||||||
function onThumbnailCreated(imgSource) {
|
|
||||||
if (imgSource == root.source) {
|
|
||||||
thumbnail.source = ThumbnailCache.thumbnail(root.source)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -201,6 +201,19 @@ Panel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update grid item when corresponding thumbnail is computed
|
||||||
|
Connections {
|
||||||
|
target: ThumbnailCache
|
||||||
|
function onThumbnailCreated(imgSource) {
|
||||||
|
for (let i = 0; i < grid.count; i++) {
|
||||||
|
let item = grid.itemAtIndex(i); // item is an ImageDelegate
|
||||||
|
if (item && item.source == imgSource) {
|
||||||
|
item.updateThumbnail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
model: SortFilterDelegateModel {
|
model: SortFilterDelegateModel {
|
||||||
id: sortedModel
|
id: sortedModel
|
||||||
model: m.viewpoints
|
model: m.viewpoints
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue