本文整理匯總了Python中PyQt5.Qt.QMessageBox.information方法的典型用法代碼示例。如果您正苦於以下問題:Python QMessageBox.information方法的具體用法?Python QMessageBox.information怎麽用?Python QMessageBox.information使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.Qt.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.information方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: saveXML
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def saveXML(self):
if len(self.tools.framemenu.getAllFrames()) > 1:
result = QFileDialog.getSaveFileName(self, 'Choose the destination for the animation file!', '.', 'Animation File (*.armo)')
if result[0] != "":
XML().toXML(self.tools.framemenu.getAllFrames(), result[0])
else:
QMessageBox.information(self, "Stickman Message", "You need at least 2 frames to save the animation!")
示例2: fromXML
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def fromXML(self):
file = QFileDialog.getOpenFileName(self, "Load Animation", ".", "Animation Files (*.armo)")
if file[0] != "":
try:
frames = XML().fromXML(file[0])
self.tools.framemenu.removeAllFrames()
for frame in frames:
self.tools.framemenu.addNewFrame(frame)
if len(frames) > 0:
getWorld().setWorldFrom(frames[0])
except:
QMessageBox.information(self, "Stickman Message", "The animation file is not valid!")
示例3: buttonExportClicked
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def buttonExportClicked(self):
(filePaths, filter) = QFileDialog.getOpenFileNames(
parent=self,
caption="轉換數據庫文件為文本格式",
directory=QApplication.applicationDirPath() + "/../data",
filter="Database file (*.db * mdb)",
)
if not filePaths:
return
#
if DatabaseMgr().convertToText(filePaths):
QMessageBox.information(self, "格式轉換", "轉換成功!")
else:
QMessageBox.warning(self, "格式轉換", "轉換失敗!")
示例4: show_font_face_rule_for_font_file
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def show_font_face_rule_for_font_file(file_data, added_name, parent=None):
try:
fm = FontMetadata(BytesIO(file_data)).to_dict()
except UnsupportedFont:
return
pp = _('Change this to the relative path to: %s') % added_name
rule = '''@font-face {{
src: url({pp});
font-family: "{ff}";
font-weight: {w};
font-style: {sy};
font-stretch: {st};
}}'''.format(pp=pp, ff=fm['font-family'], w=fm['font-weight'], sy=fm['font-style'], st=fm['font-stretch'])
QApplication.clipboard().setText(rule)
QMessageBox.information(parent, _('Font file added'), _(
'The font file <b>{}</b> has been added. The text for the CSS @font-face rule for this file has been copied'
' to the clipboard. You should paste it into whichever CSS file you want to add this font to.').format(added_name))
示例5: _monkey_clicked
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def _monkey_clicked(self, row, col):
employee = self.tbl.item(row, 0).text()
monkey = self.monkeys[col - 2]
hdr = '%s\n%s' % (employee, Monkey.prettify(monkey))
lines = []
total = 0
for asn in self.efforts[employee].assignments:
interval = TimeInterval(
first_month=asn.first_month,
last_month=asn.last_month
)
asn_monkeys = Monkey.monkey_list(interval)
if monkey in asn_monkeys:
lines.append('%s: %d' % (asn.project_name, asn.effort))
total += asn.effort
msg = hdr + '\n\n' + '\n'.join(lines) + ('\n\nTotal: %d' % total)
QMessageBox.information(QMessageBox(), 'Effort Breakdown', msg)
示例6: show_dialog
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def show_dialog(self):
QMessageBox.information(self, 'A test dialog', 'While this dialog is shown, the global menu should be hidden')
示例7: javaScriptAlert
# 需要導入模塊: from PyQt5.Qt import QMessageBox [as 別名]
# 或者: from PyQt5.Qt.QMessageBox import information [as 別名]
def javaScriptAlert(self, frame, msg):
QMessageBox.information(self.view().parentWidget(), None, msg)