当前位置: 首页>>代码示例>>Python>>正文


Python QMessageBox.Information方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QMessageBox.Information方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.Information方法的具体用法?Python QMessageBox.Information怎么用?Python QMessageBox.Information使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QMessageBox的用法示例。


在下文中一共展示了QMessageBox.Information方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_finished_signal

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def test_finished_signal(qtbot):
    """Make sure we can pass a slot to be called when the dialog finished."""
    signal_triggered = False

    def on_finished():
        nonlocal signal_triggered
        signal_triggered = True

    box = msgbox.msgbox(parent=None, title='foo', text='foo',
                        icon=QMessageBox.Information, on_finished=on_finished)

    qtbot.add_widget(box)

    with qtbot.waitSignal(box.finished):
        box.accept()

    assert signal_triggered 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:19,代码来源:test_msgbox.py

示例2: helper

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def helper(self):
        """Display help."""
        msg = QMessageBox()
        msg.setIcon(QMessageBox.Information)

        msg.setText("This simple python script allows you to generate a "
                    "worklog in rst format based on your repo commits.")
        msg.setInformativeText("You need to generated a token first.")
        msg.setWindowTitle("Help")
        msg.setWindowIcon(QIcon(ICON_PATH))
        msg.setDetailedText("Simply generate a personnal access token and "
                            "enter it in the first field of the window."
                            "\r\n"
                            "In order to generate this token, go to "
                            "https://github.com/settings/tokens "
                            "under \"Personal access tokens\".")
        msg.exec_() 
开发者ID:DedSecInside,项目名称:Awesome-Scripts,代码行数:19,代码来源:work_log.py

示例3: test_MuFileList_show_confirm_overwrite_dialog

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def test_MuFileList_show_confirm_overwrite_dialog(qtapp):
    """
    Ensure the user is notified of an existing file.
    """
    mfl = mu.interface.panes.MuFileList()
    mock_qmb = mock.MagicMock()
    mock_qmb.setIcon = mock.MagicMock(return_value=None)
    mock_qmb.setText = mock.MagicMock(return_value=None)
    mock_qmb.setWindowTitle = mock.MagicMock(return_value=None)
    mock_qmb.exec_ = mock.MagicMock(return_value=QMessageBox.Ok)
    mock_qmb_class = mock.MagicMock(return_value=mock_qmb)
    mock_qmb_class.Ok = QMessageBox.Ok
    mock_qmb_class.Information = QMessageBox.Information
    with mock.patch("mu.interface.panes.QMessageBox", mock_qmb_class):
        assert mfl.show_confirm_overwrite_dialog()
    msg = "File already exists; overwrite it?"
    mock_qmb.setText.assert_called_once_with(msg)
    mock_qmb.setWindowTitle.assert_called_once_with("File already exists")
    mock_qmb.setIcon.assert_called_once_with(QMessageBox.Information) 
开发者ID:mu-editor,项目名称:mu,代码行数:21,代码来源:test_panes.py

示例4: test_plain_text

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def test_plain_text(qtbot, plain_text, expected):
    box = msgbox.msgbox(parent=None, title='foo', text='foo',
                        icon=QMessageBox.Information, plain_text=plain_text)
    qtbot.add_widget(box)
    assert box.textFormat() == expected 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:7,代码来源:test_msgbox.py

示例5: information

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def information(*args, **kwargs):
    """Display an information box.

    Args:
        *args: Passed to msgbox.
        **kwargs: Passed to msgbox.

    Return:
        A new QMessageBox.
    """
    return msgbox(*args, icon=QMessageBox.Information, **kwargs) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:13,代码来源:msgbox.py

示例6: closeEvent

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def closeEvent(self, event):
        app_cache.save_window_size(self)
        self.finishing = True
        if self.dashd_intf:
            self.dashd_intf.disconnect()

        if self.app_config.is_modified():
            if self.queryDlg('Configuration modified. Save?',
                             buttons=QMessageBox.Yes | QMessageBox.No,
                             default_button=QMessageBox.Yes, icon=QMessageBox.Information) == QMessageBox.Yes:
                self.save_configuration()
        self.app_config.close() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:14,代码来源:main_dlg.py

示例7: _write_example_data

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def _write_example_data(self):
        try:
            mdt.utils.get_example_data(self.outputFile.text())
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Information)
            msg.setText('The MDT example data has been written to {}.'.format(self.outputFile.text()))
            msg.setWindowTitle('Success')
            msg.exec_()
        except IOError as e:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Critical)
            msg.setText(str(e))
            msg.setWindowTitle("File writing error")
            msg.exec_() 
开发者ID:robbert-harms,项目名称:MDT,代码行数:16,代码来源:qt_main.py

示例8: mess

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def mess(self,text,inf,title):
        self.msg = QMessageBox()
        self.msg.setText('{}' .format(text))

        self.msg.setSizeGripEnabled(True)
        self.msg.setInformativeText('{}'.format(inf))
        self.msg.setWindowTitle('{}'.format(title))
        self.msg.setIcon(QMessageBox.Information)

        self.execmsg = self.msg.exec_() 
开发者ID:azizaltuntas,项目名称:Camelishing,代码行数:12,代码来源:smtp.py

示例9: mess

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def mess(self,text,inf,title):

        self.msg = QMessageBox()
        self.msg.setText('{}' .format(text))

        self.msg.setSizeGripEnabled(True)
        self.msg.setInformativeText('{}'.format(inf))
        self.msg.setWindowTitle('{}'.format(title))
        self.msg.setIcon(QMessageBox.Information)

        self.execmsg = self.msg.exec_() 
开发者ID:azizaltuntas,项目名称:Camelishing,代码行数:13,代码来源:start.py

示例10: mess

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def mess(self, text, inf, title):
        self.msg = QMessageBox()
        self.msg.setText('{}'.format(text))
        self.msg.setInformativeText('{}'.format(inf))
        self.msg.setWindowTitle('{}'.format(title))
        self.msg.setIcon(QMessageBox.Information)

        self.execmsg = self.msg.exec_() 
开发者ID:azizaltuntas,项目名称:Camelishing,代码行数:10,代码来源:messagebox.py

示例11: dinformation

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def dinformation(title, text, detailed_text, parent=None):
        """MessageBox with "Information" icon"""
        QDetailedMessageBox.dgeneric(title,
                                     text,
                                     detailed_text,
                                     QMessageBox.Information,
                                     parent) 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:9,代码来源:qmessagebox.py

示例12: MYABOUT

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def MYABOUT(self):
        box = QtWidgets.QMessageBox(self.obj)
        msg = """
        This program is coded by <b>Gurkirat Singh (T3r@bYt3)</b>. <br><br><br>
        Thanks to : <b>Sameer Bhatt</b> (for giving me the implementation example)
        """
        box.setStandardButtons(QMessageBox.Ok)
        box.setIcon(QMessageBox.Information)
        box.setWindowTitle("About")
        box.setText(msg)
        box.show()
        pass 
开发者ID:tbhaxor,项目名称:whatabomb,代码行数:14,代码来源:bomb.py

示例13: display_info_box

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def display_info_box(msg, title="Message"):
    msgbox = QMessageBox()
    msgbox.setIcon(QMessageBox.Information)
    msgbox.setText(msg)
    msgbox.setWindowTitle(title)
    msgbox.setStandardButtons(QMessageBox.Ok)
    return msgbox.exec_() 
开发者ID:roglew,项目名称:guppy-proxy,代码行数:9,代码来源:util.py

示例14: train

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def train(self):
        try:
            if not os.path.isdir(self.datasets):
                raise FileNotFoundError

            text = '系统将开始训练人脸数据,界面会暂停响应一段时间,完成后会弹出提示。'
            informativeText = '<b>训练过程请勿进行其它操作,是否继续?</b>'
            ret = DataManageUI.callDialog(QMessageBox.Question, text, informativeText,
                                          QMessageBox.Yes | QMessageBox.No,
                                          QMessageBox.No)
            if ret == QMessageBox.Yes:
                face_recognizer = cv2.face.LBPHFaceRecognizer_create()
                if not os.path.exists('./recognizer'):
                    os.makedirs('./recognizer')
            faces, labels = self.prepareTrainingData(self.datasets)
            face_recognizer.train(faces, np.array(labels))
            face_recognizer.save('./recognizer/trainingData.yml')
        except FileNotFoundError:
            logging.error('系统找不到人脸数据目录{}'.format(self.datasets))
            self.trainButton.setIcon(QIcon('./icons/error.png'))
            self.logQueue.put('未发现人脸数据目录{},你可能未进行人脸采集'.format(self.datasets))
        except Exception as e:
            logging.error('遍历人脸库出现异常,训练人脸数据失败')
            self.trainButton.setIcon(QIcon('./icons/error.png'))
            self.logQueue.put('Error:遍历人脸库出现异常,训练失败')
        else:
            text = '<font color=green><b>Success!</b></font> 系统已生成./recognizer/trainingData.yml'
            informativeText = '<b>人脸数据训练完成!</b>'
            DataManageUI.callDialog(QMessageBox.Information, text, informativeText, QMessageBox.Ok)
            self.trainButton.setIcon(QIcon('./icons/success.png'))
            self.logQueue.put('Success:人脸数据训练完成')
            self.initDb()

    # 系统日志服务常驻,接收并处理系统日志 
开发者ID:winterssy,项目名称:face_recognition_py,代码行数:36,代码来源:dataManage.py

示例15: msg_box_info

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Information [as 别名]
def msg_box_info(text, *args, **kwargs):
    return msg_box(text, *args, **kwargs,
                   buttons=QMessageBox.Yes, default=QMessageBox.Yes,
                   type=QMessageBox.Information) 
开发者ID:TuringApp,项目名称:Turing,代码行数:6,代码来源:widgets.py


注:本文中的PyQt5.QtWidgets.QMessageBox.Information方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。