Skip to content

Commit

Permalink
[ui] Edge: Added slot to get if a point exists on the edgeArea component
Browse files Browse the repository at this point in the history
  • Loading branch information
waaake committed Jan 22, 2025
1 parent 6071a91 commit 9a582bb
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions meshroom/ui/components/edge.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6.QtCore import Signal, Property, QPointF, Qt, QObject
from PySide6.QtCore import Signal, Slot, Property, QPointF, Qt, QObject
from PySide6.QtGui import QPainterPath, QVector2D
from PySide6.QtQuick import QQuickItem

Expand Down Expand Up @@ -51,19 +51,6 @@ def geometryChanged(self, newGeometry, oldGeometry):
super(EdgeMouseArea, self).geometryChanged(newGeometry, oldGeometry)
self.updateShape()

def mousePressEvent(self, evt):
if not self.acceptedMouseButtons() & evt.button():
evt.setAccepted(False)
return
e = MouseEvent(evt)
self.pressed.emit(e)
e.deleteLater()

def mouseReleaseEvent(self, evt):
e = MouseEvent(evt)
self.released.emit(e)
e.deleteLater()

def updateShape(self):
p1 = QPointF(0, 0)
p2 = QPointF(self.width(), self.height())
Expand Down Expand Up @@ -109,6 +96,10 @@ def setContainsMouse(self, value):
return
self._containsMouse = value
self.containsMouseChanged.emit()

@Slot(QPointF, result=bool)
def containsPoint(self, point):
return self.contains(point)

thicknessChanged = Signal()
thickness = Property(float, getThickness, setThickness, notify=thicknessChanged)
Expand Down

0 comments on commit 9a582bb

Please sign in to comment.