1
0

QT handler improvements

Now we have the top_level_window() function, stop using the window
stack.
This commit is contained in:
Neil Booth
2016-01-10 12:16:34 +09:00
parent 83cc5e2001
commit 9cf0a9720f
2 changed files with 12 additions and 19 deletions

View File

@@ -159,7 +159,8 @@ class MessageBoxMixin(object):
def top_level_window(self, window=None):
window = window or self
for n, child in enumerate(window.children()):
if isinstance(child, WindowModalDialog):
# Test for visibility as old closed dialogs may not be GC-ed
if isinstance(child, WindowModalDialog) and child.isVisible():
return self.top_level_window(child)
return window