main_window.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:uitester 作者: IfengAutomation 项目源码 文件源码
def closeEvent(self, event):
        """
        close window event
        :return:
        """
        if not hasattr(self, 'case_edit_window'):  # case_edit_window is not exist
            self.close()
            return
        if not self.case_edit_window.isVisible():  # case_edit_window is not visible
            self.close()
            return

        # signal for case_edit_window's closeEvent
        self.case_edit_window.close_cancel_signal.connect(self.editor_close_ignore, Qt.DirectConnection)

        # case_edit_window is visible
        reply = self.message_box.question(self, "Confirm Close?", "The editor is opened, still close?",
                                          QMessageBox.Yes | QMessageBox.Cancel)
        if reply == QMessageBox.Yes:
            self.is_editor_close_cancel = False
            self.case_edit_window.close()
            if self.is_editor_close_cancel:   # editor close is canceled
                event.ignore()
                return
            self.close()
        else:
            event.ignore()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号