Skip to content

Commit e51bb93

Browse files
authored
Merge pull request #2650 from alicevision/fix/CrashingEdge
[ui][fix] Edge: Fixing an issue with mouse event on Custom EdgeMouseArea causing Crash
2 parents 2eb30fe + 870dcf4 commit e51bb93

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

meshroom/ui/components/edge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, evt):
1717
x = Property(float, lambda self: self._x, constant=True)
1818
y = Property(float, lambda self: self._y, constant=True)
1919
button = Property(Qt.MouseButton, lambda self: self._button, constant=True)
20-
modifiers = Property(int, lambda self: self._modifiers, constant=True)
20+
modifiers = Property(Qt.KeyboardModifier, lambda self: self._modifiers, constant=True)
2121

2222

2323
class EdgeMouseArea(QQuickItem):
@@ -47,8 +47,8 @@ def hoverLeaveEvent(self, evt):
4747
self.setContainsMouse(False)
4848
super(EdgeMouseArea, self).hoverLeaveEvent(evt)
4949

50-
def geometryChanged(self, newGeometry, oldGeometry):
51-
super(EdgeMouseArea, self).geometryChanged(newGeometry, oldGeometry)
50+
def geometryChange(self, newGeometry, oldGeometry):
51+
super(EdgeMouseArea, self).geometryChange(newGeometry, oldGeometry)
5252
self.updateShape()
5353

5454
def mousePressEvent(self, evt):

meshroom/ui/qml/GraphEditor/Edge.qml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,13 @@ Item {
138138
anchors.fill: parent
139139
acceptedButtons: Qt.LeftButton | Qt.RightButton
140140
thickness: root.thickness + 4
141+
curveScale: cubic.ctrlPtDist / root.width // Normalize by width
141142
onPressed: function(event) {
142143
root.pressed(event)
143144
}
144145
onReleased: function(event) {
145146
root.released(event)
146147
}
147148

148-
Component.onCompleted: {
149-
/* The curve scale must be set only once the component has been fully created, so
150-
* that all the events following the update of the curve scale can be taken into
151-
* account. */
152-
curveScale = Qt.binding(() => cubic.ctrlPtDist / root.width) // Normalize by width
153-
}
154149
}
155150
}

0 commit comments

Comments
 (0)