Skip to content

Commit 95f7190

Browse files
committed
[ui][qml] GraphEditor: Added helper for nodeRepeater to get the item at a given index
With the change in nodeRepeater to hold the Loader instead of active delegate, fetching the item at a given index involves getting the loader at index and then it's item. This function allows easy access to the item directly.
1 parent bf6f765 commit 95f7190

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

meshroom/ui/qml/GraphEditor/GraphEditor.qml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,19 @@ Item {
833833
property bool updateSelectionOnClick: false
834834
property var temporaryEdgeAboutToBeRemoved: undefined
835835

836+
function getItemAt(index) {
837+
/**
838+
* Helper function to get actual item from the repeater at a given index.
839+
*/
840+
const loader = itemAt(index);
841+
842+
if (loader && loader.item) {
843+
return loader.item;
844+
}
845+
846+
return null;
847+
}
848+
836849
delegate: Loader {
837850
id: nodeLoader
838851
Component {

0 commit comments

Comments
 (0)