Skip to content

Commit

Permalink
Handle RuntimeError when hiding cursor on FocusOut event
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Nov 7, 2024
1 parent ae68a02 commit 880a76b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qwt/tests/test_eventfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ def eventFilter(self, object, event):
if event.type() == QEvent.FocusIn:
self.__showCursor(True)
if event.type() == QEvent.FocusOut:
self.__showCursor(False)
try:
self.__showCursor(False)
except RuntimeError:
pass # ignore error when closing the application
if event.type() == QEvent.Paint:
QApplication.postEvent(self, QEvent(QEvent.User))
elif event.type() == QEvent.MouseButtonPress:
Expand Down

0 comments on commit 880a76b

Please sign in to comment.