GraphicsScene.py : check for C++ item live-ness
this gets triggered in PySide6 but not in PyQt5, PySide2.
This commit is contained in:
parent
10530568f0
commit
74683be68b
@ -3,7 +3,7 @@ import time
|
||||
import weakref
|
||||
import warnings
|
||||
|
||||
from ..Qt import QtCore, QtGui
|
||||
from ..Qt import QtCore, QtGui, isQObjectAlive
|
||||
from ..Point import Point
|
||||
from .. import functions as fn
|
||||
from .. import ptime as ptime
|
||||
@ -298,7 +298,9 @@ class GraphicsScene(QtGui.QGraphicsScene):
|
||||
for item in prevItems:
|
||||
event.currentItem = item
|
||||
try:
|
||||
if item.scene() is self:
|
||||
# NOTE: isQObjectAlive(item) was added for PySide6 where
|
||||
# verlet_chain_demo.py triggers a RuntimeError.
|
||||
if isQObjectAlive(item) and item.scene() is self:
|
||||
item.hoverEvent(event)
|
||||
except:
|
||||
debug.printExc("Error sending hover exit event:")
|
||||
|
Loading…
x
Reference in New Issue
Block a user