|
|
@ -148,9 +148,10 @@ class CancelButton(QPushButton): |
|
|
|
class MessageBoxMixin(object): |
|
|
|
def top_level_window(self, window=None): |
|
|
|
window = window or self |
|
|
|
classes = (WindowModalDialog, QMessageBox) |
|
|
|
for n, child in enumerate(window.children()): |
|
|
|
# Test for visibility as old closed dialogs may not be GC-ed |
|
|
|
if isinstance(child, WindowModalDialog) and child.isVisible(): |
|
|
|
if isinstance(child, classes) and child.isVisible(): |
|
|
|
return self.top_level_window(child) |
|
|
|
return window |
|
|
|
|
|
|
|