Skip to content

Commit 880a76b

Browse files
committed
Handle RuntimeError when hiding cursor on FocusOut event
1 parent ae68a02 commit 880a76b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qwt/tests/test_eventfilter.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@ def eventFilter(self, object, event):
243243
if event.type() == QEvent.FocusIn:
244244
self.__showCursor(True)
245245
if event.type() == QEvent.FocusOut:
246-
self.__showCursor(False)
246+
try:
247+
self.__showCursor(False)
248+
except RuntimeError:
249+
pass # ignore error when closing the application
247250
if event.type() == QEvent.Paint:
248251
QApplication.postEvent(self, QEvent(QEvent.User))
249252
elif event.type() == QEvent.MouseButtonPress:

0 commit comments

Comments
 (0)