mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[ui] Edge: Added slot to fetch if a point exists on the path
Removed mousePress and mouseReleased events Invoking custom Event or querying mouse buttons from the provided QMouseEvent crashes meshroom, this comes as first part of the workaround for querying when a point exists on the path
This commit is contained in:
parent
91885afe11
commit
5bcc55c19f
1 changed files with 5 additions and 14 deletions
|
@ -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
|
||||
|
||||
|
@ -51,19 +51,6 @@ class EdgeMouseArea(QQuickItem):
|
|||
super(EdgeMouseArea, self).geometryChange(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())
|
||||
|
@ -110,6 +97,10 @@ class EdgeMouseArea(QQuickItem):
|
|||
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)
|
||||
curveScaleChanged = Signal()
|
||||
|
|
Loading…
Add table
Reference in a new issue