mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-12 07:42:04 +02:00
[ui] GraphEditor: Introduced DelegateSelectionLine to the graph editor
Upon selection end the found intersected edges gets removed
This commit is contained in:
parent
7883b51c20
commit
3b1e7e9420
1 changed files with 18 additions and 1 deletions
|
@ -143,6 +143,7 @@ Item {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property double factor: 1.15
|
property double factor: 1.15
|
||||||
|
property bool removingEdges: false;
|
||||||
// Activate multisampling for edges antialiasing
|
// Activate multisampling for edges antialiasing
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.samples: 8
|
layer.samples: 8
|
||||||
|
@ -151,7 +152,7 @@ Item {
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
drag.threshold: 0
|
drag.threshold: 0
|
||||||
drag.smoothed: false
|
drag.smoothed: false
|
||||||
cursorShape: drag.target == draggable ? Qt.ClosedHandCursor : Qt.ArrowCursor
|
cursorShape: drag.target == draggable ? Qt.ClosedHandCursor : removingEdges ? Qt.CrossCursor : Qt.ArrowCursor
|
||||||
|
|
||||||
onWheel: function(wheel) {
|
onWheel: function(wheel) {
|
||||||
var zoomFactor = wheel.angleDelta.y > 0 ? factor : 1 / factor
|
var zoomFactor = wheel.angleDelta.y > 0 ? factor : 1 / factor
|
||||||
|
@ -176,9 +177,15 @@ Item {
|
||||||
if (mouse.button == Qt.MiddleButton || (mouse.button == Qt.LeftButton && mouse.modifiers & Qt.AltModifier)) {
|
if (mouse.button == Qt.MiddleButton || (mouse.button == Qt.LeftButton && mouse.modifiers & Qt.AltModifier)) {
|
||||||
drag.target = draggable // start drag
|
drag.target = draggable // start drag
|
||||||
}
|
}
|
||||||
|
if (mouse.button == Qt.LeftButton && (mouse.modifiers & Qt.ControlModifier) && (mouse.modifiers & Qt.AltModifier)) {
|
||||||
|
edgeSelectionLine.startSelection(mouse);
|
||||||
|
removingEdges = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
removingEdges = false;
|
||||||
|
edgeSelectionLine.endSelection()
|
||||||
nodeSelectionBox.endSelection();
|
nodeSelectionBox.endSelection();
|
||||||
drag.target = null;
|
drag.target = null;
|
||||||
root.forceActiveFocus()
|
root.forceActiveFocus()
|
||||||
|
@ -1005,6 +1012,16 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DelegateSelectionLine {
|
||||||
|
id: edgeSelectionLine
|
||||||
|
mouseArea: mouseArea
|
||||||
|
modelInstantiator: edgesRepeater
|
||||||
|
container: draggable
|
||||||
|
onDelegateSelectionEnded: function(selectedIndices, modifiers) {
|
||||||
|
uigraph.deleteEdgesByIndices(selectedIndices);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DropArea {
|
DropArea {
|
||||||
id: dropArea
|
id: dropArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue