Browse Source

QMessageBox is a top-level window

283
Neil Booth 9 years ago
parent
commit
e2627e0944
  1. 3
      gui/qt/util.py

3
gui/qt/util.py

@ -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

Loading…
Cancel
Save