• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python QtGui.QMessageBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中winpython.qt.QtGui.QMessageBox的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox类的具体用法?Python QMessageBox怎么用?Python QMessageBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: add_packages

 def add_packages(self, fnames):
     """Add packages"""
     notsupported = []
     notcompatible = []
     dist = self.distribution
     for fname in fnames:
         bname = osp.basename(fname)
         try:
             package = wppm.Package(fname)
             if package.is_compatible_with(dist):
                 self.add_package(package)
             else:
                 notcompatible.append(bname)
         except NotImplementedError:
             notsupported.append(bname)
     # PyQt4 old SIGNAL: self.emit(SIGNAL('package_added()'))
     self.package_added.emit()
     if notsupported:
         QMessageBox.warning(
             self,
             "Warning",
             "The following packages filenaming are <b>not "
             "recognized</b> by %s:\n\n%s" % (self.winname, "<br>".join(notsupported)),
             QMessageBox.Ok,
         )
     if notcompatible:
         QMessageBox.warning(
             self,
             "Warning",
             "The following packages "
             "are <b>not compatible</b> with "
             "Python <u>%s %dbit</u>:\n\n%s" % (dist.version, dist.architecture, "<br>".join(notcompatible)),
             QMessageBox.Ok,
         )
开发者ID:psycow,项目名称:winpython,代码行数:34,代码来源:controlpanel.py


示例2: about

 def about(self):
     """About this program"""
     QMessageBox.about(
         self,
         "About %s" % self.NAME,
         """<b>%s %s</b>
         <br>Package Manager and Advanced Tasks
         <p>Copyright &copy; 2012 Pierre Raybaut
         <br>Licensed under the terms of the MIT License
         <p>Created, developed and maintained by Pierre Raybaut
         <p><a href="%s">WinPython at Github.io</a>: downloads, bug reports,
         discussions, etc.</p>
         <p>This program is executed by:<br>
         <b>%s</b><br>
         Python %s, Qt %s, %s %s"""
         % (
             self.NAME,
             __version__,
             __project_url__,
             python_distribution_infos(),
             platform.python_version(),
             winpython.qt.QtCore.__version__,
             winpython.qt.API_NAME,
             winpython.qt.__version__,
         ),
     )
开发者ID:psycow,项目名称:winpython,代码行数:26,代码来源:controlpanel.py


示例3: about

 def about(self):
     """About this program"""
     QMessageBox.about(
         self,
         "About %s" % self.NAME,
         """<b>%s %s</b>
         <br>Package Manager and Advanced Tasks
         <p>Copyright &copy; 2012 Pierre Raybaut
         <br>Licensed under the terms of the MIT License
         <p>Created, developed and maintained by Pierre Raybaut
         <p>WinPython's community:
         <ul><li>Bug reports and feature requests: 
         <a href="%s">Google Code</a>
         </li><li>Discussions around the project: 
         <a href="%s">Google Group</a>
         </li></ul>
         <p>This program is executed by:<br>
         <b>%s</b><br>
         Python %s, Qt %s, %s %s"""
         % (
             self.NAME,
             __version__,
             __project_url__,
             __forum_url__,
             python_distribution_infos(),
             platform.python_version(),
             winpython.qt.QtCore.__version__,
             winpython.qt.API_NAME,
             winpython.qt.__version__,
         ),
     )
开发者ID:grakidov,项目名称:buildtools,代码行数:31,代码来源:controlpanel.py


示例4: process_packages

 def process_packages(self, action):
     """Install/uninstall packages"""
     if action == "install":
         text, table = "Installing", self.table
         if not self.get_packages_to_be_installed():
             return
     elif action == "uninstall":
         text, table = "Uninstalling", self.untable
     else:
         raise AssertionError
     packages = table.get_selected_packages()
     if not packages:
         return
     func = getattr(self.distribution, action)
     thread = Thread(self)
     for widget in self.children():
         if isinstance(widget, QWidget):
             widget.setEnabled(False)
     try:
         status = self.statusBar()
     except AttributeError:
         status = self.parent().statusBar()
     progress = QProgressDialog(self, Qt.FramelessWindowHint)
     progress.setMaximum(len(packages))  #  old vicious bug:len(packages)-1
     for index, package in enumerate(packages):
         progress.setValue(index)
         progress.setLabelText("%s %s %s..." % (text, package.name, package.version))
         QApplication.processEvents()
         if progress.wasCanceled():
             break
         if package in table.model.actions:
             try:
                 thread.callback = lambda: func(package)
                 thread.start()
                 while thread.isRunning():
                     QApplication.processEvents()
                     if progress.wasCanceled():
                         status.setEnabled(True)
                         status.showMessage("Cancelling operation...")
                 table.remove_package(package)
                 error = thread.error
             except Exception as error:
                 error = to_text_string(error)
             if error is not None:
                 pstr = package.name + " " + package.version
                 QMessageBox.critical(
                     self,
                     "Error",
                     "<b>Unable to %s <i>%s</i></b>" "<br><br>Error message:<br>%s" % (action, pstr, error),
                 )
     progress.setValue(progress.maximum())
     status.clearMessage()
     for widget in self.children():
         if isinstance(widget, QWidget):
             widget.setEnabled(True)
     thread = None
     for table in (self.table, self.untable):
         table.refresh_distribution(self.distribution)
开发者ID:psycow,项目名称:winpython,代码行数:58,代码来源:controlpanel.py


示例5: select_directory

 def select_directory(self):
     """Select directory"""
     basedir = to_text_string(self.line_edit.text())
     if not osp.isdir(basedir):
         basedir = getcwd()
     while True:
         directory = getexistingdirectory(self, self.TITLE, basedir)
         if not directory:
             break
         if not utils.is_python_distribution(directory):
             QMessageBox.warning(self, self.TITLE,
                 "The following directory is not a Python distribution.",
                 QMessageBox.Ok)
             basedir = directory
             continue
         directory = osp.abspath(osp.normpath(directory))
         self.set_distribution(directory)
         self.emit(SIGNAL('selected_distribution(QString)'), directory)
         break
开发者ID:Chaos99,项目名称:winpython,代码行数:19,代码来源:controlpanel.py


示例6: unregister_distribution

 def unregister_distribution(self):
     """Unregister distribution"""
     answer = QMessageBox.warning(self, "Unregister distribution",
         "This will remove file extensions associations, icons and "
         "Windows explorer's context menu entries ('Edit with IDLE', ...) "
         "with selected Python distribution in Windows registry. "
         "<br>Shortcuts for all WinPython launchers will be removed "
         "from <i>WinPython</i> Start menu group."
         "<br>If <i>pywin32</i> is installed (it should be on any "
         "WinPython distribution), the Python ActiveX Scripting client "
         "will also be unregistered."
         "<br><br>Do you want to continue?",
         QMessageBox.Yes | QMessageBox.No)
     if answer == QMessageBox.Yes:
         associate.unregister(self.distribution.target)
开发者ID:Chaos99,项目名称:winpython,代码行数:15,代码来源:controlpanel.py


示例7: register_distribution

 def register_distribution(self):
     """Register distribution"""
     answer = QMessageBox.warning(self, "Register distribution",
         "This will associate file extensions, icons and "
         "Windows explorer's context menu entries ('Edit with IDLE', ...) "
         "with selected Python distribution in Windows registry. "
         "<br>Shortcuts for all WinPython launchers will be installed "
         "in <i>WinPython</i> Start menu group (replacing existing "
         "shortcuts)."
         "<br>If <i>pywin32</i> is installed (it should be on any "
         "WinPython distribution), the Python ActiveX Scripting client "
         "will also be registered."
         "<br><br><u>Warning</u>: the only way to undo this change is to "
         "register another Python distribution to Windows registry."
         "<br><br><u>Note</u>: these actions are exactly the same as those "
         "performed when installing Python with the official installer "
         "for Windows.<br><br>Do you want to continue?",
         QMessageBox.Yes | QMessageBox.No)
     if answer == QMessageBox.Yes:
         associate.register(self.distribution.target)
开发者ID:Chaos99,项目名称:winpython,代码行数:20,代码来源:controlpanel.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python protocol.Protocol类代码示例发布时间:2022-05-26
下一篇:
Python windows.UIInterface类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap