當前位置: 首頁>>代碼示例>>Python>>正文


Python QMessageBox.question方法代碼示例

本文整理匯總了Python中PyQt5.Qt.QMessageBox.question方法的典型用法代碼示例。如果您正苦於以下問題:Python QMessageBox.question方法的具體用法?Python QMessageBox.question怎麽用?Python QMessageBox.question使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.Qt.QMessageBox的用法示例。


在下文中一共展示了QMessageBox.question方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _remove_clicked

# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 別名]
 def _remove_clicked(self):
     nickname = self.ui.nicknameEdit.text()
     msg = 'Are you sure you want to remove project ' + nickname + '?'
     reply = QMessageBox.question(QMessageBox(), 'Double check', msg)
     if reply == QMessageBox.Yes:
         rec = Dataset.projects[nickname]
         rec.remove()
         del Dataset.projects[nickname]
         self._load_list(Dataset.projects.keys())
開發者ID:joegillon,項目名稱:allocat_effort,代碼行數:11,代碼來源:project_window.py

示例2: deleteFrame

# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 別名]
 def deleteFrame(self, caller):
     if not self.buttons.active == None:
         response = QMessageBox.question(caller, 'Frame Remove Message', "Are you sure you want to delete this frame?", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
         if response == QMessageBox.Yes:
             self.buttons.active.setParent(None)
             del self.buttons[self.buttons.active]
             if self.start_index > 0:
                 self.start_index = self.start_index-1
             self.parent().canvas.hideMessage()
     self.rearrangeButtons()
開發者ID:artemmoskalev,項目名稱:stickman_animator,代碼行數:12,代碼來源:Lists.py

示例3: exportToPDF

# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 別名]
    def exportToPDF(self):
        if self.slotsExportedDisabled_:
            return

        util = FLUtil()
        fileName = QFileDialog.getSaveFileName(
            self,
            util.translate("app", "Exportar a PDF"),
            "",
            util.translate("app", "Fichero PDF (*.pdf)")
        )

        if fileName[0] == '':
            return

        if fileName[0].upper().find(".PDF") == -1:
            fileName = fileName[0] + ".pdf"

        if QtCore.QFile.exists(fileName):

            q = QMessageBox.question(
                self,
                util.translate("app", "Sobreescribir {}").format(fileName),
                util.translate(
                    "app",
                    "Ya existe un fichero llamado {}. ¿Desea sobreescribirlo?"
                ).format(fileName),
                util.translate("app", "&Sí"),
                util.translate("app", "&No"),
                "",
                0,
                1
            )
            if q:
                return

        self.slotPrintReportToPdf(fileName)
開發者ID:juanjosepablos,項目名稱:pineboo,代碼行數:39,代碼來源:flreportviewer.py

示例4: _remove_clicked

# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 別名]
 def _remove_clicked(self):
     # nickname = self.ui.nicknameEdit.text()
     msg = 'Are you sure you want to remove assignment ?'
     reply = QMessageBox.question(QMessageBox(), 'Double check', msg)
開發者ID:joegillon,項目名稱:allocat_effort,代碼行數:6,代碼來源:assignment_dialog.py

示例5: javaScriptConfirm

# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 別名]
	def javaScriptConfirm(self, frame, msg):
		return QMessageBox.question(self.view().parentWidget(), None, msg) == QMessageBox.Yes
開發者ID:Fe-ver,項目名稱:hae,代碼行數:4,代碼來源:webpage.py


注:本文中的PyQt5.Qt.QMessageBox.question方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。