當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。