mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Use isinstance for comparison
This commit is contained in:
parent
cdfa6ebd40
commit
72c7cb674a
1 changed files with 2 additions and 2 deletions
|
@ -347,7 +347,7 @@ class AnkiApp(QApplication):
|
||||||
|
|
||||||
def eventFilter(self, src: Any, evt: QEvent) -> bool:
|
def eventFilter(self, src: Any, evt: QEvent) -> bool:
|
||||||
if evt.type() == QEvent.Type.HoverEnter:
|
if evt.type() == QEvent.Type.HoverEnter:
|
||||||
if type(src) == QPushButton:
|
if isinstance(src, QPushButton):
|
||||||
# TODO: apply drop-shadow with setGraphicsEffect(QGraphicsDropShadowEffect)
|
# TODO: apply drop-shadow with setGraphicsEffect(QGraphicsDropShadowEffect)
|
||||||
# issue: can't access attributes of QClassProxy (Qt5-compat)
|
# issue: can't access attributes of QClassProxy (Qt5-compat)
|
||||||
self.setOverrideCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
self.setOverrideCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
||||||
|
@ -355,7 +355,7 @@ class AnkiApp(QApplication):
|
||||||
self.restoreOverrideCursor()
|
self.restoreOverrideCursor()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
elif evt.type() == QEvent.Type.HoverLeave or evt.type() == QCloseEvent:
|
elif evt.type() == QEvent.Type.HoverLeave or isinstance(evt, QCloseEvent):
|
||||||
self.restoreOverrideCursor()
|
self.restoreOverrideCursor()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue