mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 02:08:08 +02:00
[Viewer] ImageMetadataView: Check that value is set before assigning it
This commit fixes the following errors: - "<Unknown File>: Can't assign to existing role 'value' of different type [VariantMap -> String]" which occurs whenever the metadata view is enabled and appears if at least one of the metadata keys has an empty value; - "Unable to assign [undefined] to QString" which occurs whenever the search bar is cleared.
This commit is contained in:
parent
b916a923e1
commit
9249615baf
1 changed files with 8 additions and 2 deletions
|
@ -94,7 +94,13 @@ FloatingPane {
|
|||
entry["group"] = "-"
|
||||
entry["key"] = key
|
||||
}
|
||||
entry["value"] = metadata[key]
|
||||
|
||||
// If a key has an empty corresponding value, set it as an empty string.
|
||||
// Otherwise it will be considered as a Variant Map.
|
||||
if (typeof(metadata[key]) != "string")
|
||||
entry["value"] = ""
|
||||
else
|
||||
entry["value"] = metadata[key]
|
||||
entry["raw"] = entry["group"] + ":" + entry["key"] + "=" + entry["value"]
|
||||
entries.push(entry)
|
||||
}
|
||||
|
@ -199,7 +205,7 @@ FloatingPane {
|
|||
elide: Text.ElideRight
|
||||
}
|
||||
Label {
|
||||
text: value
|
||||
text: value != undefined ? value : ""
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Label.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue