Skip to content

Commit 1129671

Browse files
committed
proper check for window flags
1 parent 4eecdd1 commit 1129671

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/asammdf/gui/dialogs/error_dialog.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ def __init__(self, title, message, trace, *args, **kwargs):
6767
self.timer.start(1000)
6868

6969
for window in QtGui.QGuiApplication.topLevelWindows():
70-
if window.flags() & QtCore.Qt.WindowFlags.SplashScreen:
70+
if hasattr(window, "flags"):
71+
flags = window.flags()
72+
else:
73+
flags = window.windowFlags()
74+
75+
if (flags & QtCore.Qt.WindowFlags.SplashScreen) == QtCore.Qt.WindowFlags.SplashScreen:
7176
window.close()
7277

7378
def copy_to_clipboard(self, event):

src/asammdf/gui/dialogs/messagebox.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ def __init__(self, *args, **kwargs):
111111
self.timer.start(1000)
112112

113113
for window in QtGui.QGuiApplication.topLevelWindows():
114-
if window.flags() & QtCore.Qt.WindowFlags.SplashScreen:
114+
if hasattr(window, "flags"):
115+
flags = window.flags()
116+
else:
117+
flags = window.windowFlags()
118+
119+
if (flags & QtCore.Qt.WindowFlags.SplashScreen) == QtCore.Qt.WindowFlags.SplashScreen:
120+
print('closing', window, flags)
121+
print(int(flags), int(QtCore.Qt.WindowFlags.SplashScreen), flags & QtCore.Qt.WindowFlags.SplashScreen)
115122
window.close()
116123

117124
def keyPressEvent(self, event):

0 commit comments

Comments
 (0)