ChoiceDialog.py 文件源码

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

项目:Cfd 作者: qingfengxia 项目源码 文件源码
def choose(choices, within_qtloop = False, parent = None):
    if not within_qtloop:
        app = QApplication(sys.argv)
        dialog = ChoiceDialog(choices, parent)
        result = dialog.open()  # show() will not get result
        app.exec_()  # dialog.exec_() will call the app.exec_()
    else:
        dialog = ChoiceDialog(choices, parent)
        result = dialog.exec_()  # show() will not get result, must using exec_() or error
    choice = dialog.getChoice()
    choiceId = dialog.getChoiceId()
    return (choice, choiceId, result == QDialog.Accepted)  # Accepted
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号