def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except Exception as e: window = _ReportingWindow( name, traceback.format_exc(), parent=QApplication.activeWindow() ) window.show() raise
def get_main_qt_window(): """ Returns QWidget representing the top most window :return: QWidget """ parent = QApplication.activeWindow() grand_parent = parent while grand_parent is not None: parent = grand_parent grand_parent = parent.parent() return parent
def main_qt_window(): """ Returns the application's top most window """ parent = QApplication.activeWindow() if parent: grand_parent = parent while grand_parent is None: parent = grand_parent grand_parent = parent.parent() return parent
def __init__(self, parent=QApplication.activeWindow()): super(MessageBox, self).__init__(parent) loadUi(osp.join(uiPath, 'msgBox.ui'), self)