Fix issue with int comparson impacting Qt6
This commit is contained in:
parent
ee951331be
commit
648b8c7df4
@ -795,13 +795,24 @@ class ROI(GraphicsObject):
|
||||
self.mouseDragHandler.mouseDragEvent(ev)
|
||||
|
||||
def mouseClickEvent(self, ev):
|
||||
with warnings.catch_warnings():
|
||||
# warning present on pyqt5 5.12 + python 3.8
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
".*Implicit conversion to integers using __int__ is "
|
||||
"deprecated, and may be removed in a future version of "
|
||||
"Python."
|
||||
),
|
||||
category=DeprecationWarning
|
||||
)
|
||||
if ev.button() == QtCore.Qt.RightButton and self.isMoving:
|
||||
ev.accept()
|
||||
self.cancelMove()
|
||||
if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled():
|
||||
self.raiseContextMenu(ev)
|
||||
ev.accept()
|
||||
elif ev.button() & self.acceptedMouseButtons() > 0:
|
||||
elif ev.button() & self.acceptedMouseButtons():
|
||||
ev.accept()
|
||||
self.sigClicked.emit(self, ev)
|
||||
else:
|
||||
@ -1400,6 +1411,17 @@ class Handle(UIGraphicsItem):
|
||||
self.update()
|
||||
|
||||
def mouseClickEvent(self, ev):
|
||||
with warnings.catch_warnings():
|
||||
# warning present on pyqt5 5.12 + python 3.8
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
".*Implicit conversion to integers using __int__ is "
|
||||
"deprecated, and may be removed in a future version of "
|
||||
"Python."
|
||||
),
|
||||
category=DeprecationWarning
|
||||
)
|
||||
## right-click cancels drag
|
||||
if ev.button() == QtCore.Qt.RightButton and self.isMoving:
|
||||
self.isMoving = False ## prevents any further motion
|
||||
|
Loading…
Reference in New Issue
Block a user