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

Python QtCore.QUrl类代码示例

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

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



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

示例1: start_file

def start_file(filename):
    """Generalized os.startfile for all platforms supported by Qt
    (this function is simply wrapping QDesktopServices.openUrl)
    Returns True if successfull, otherwise returns False."""
    from spyderlib.qt.QtGui import QDesktopServices
    from spyderlib.qt.QtCore import QUrl
    url = QUrl()
    url.setUrl(filename)
    return QDesktopServices.openUrl(url)
开发者ID:DoctorMalboro,项目名称:prymatex,代码行数:9,代码来源:programs.py


示例2: show_intro_message

    def show_intro_message(self):
        intro_message = _("Here you can get help of any object by pressing "
                          "%s in front of it, either on the Editor or the "
                          "Console.%s"
                          "Help can also be shown automatically after writing "
                          "a left parenthesis next to an object. You can "
                          "activate this behavior in %s.")
        prefs = _("Preferences > Help")
        if sys.platform == 'darwin':
            shortcut = "Cmd+I"
        else:
            shortcut = "Ctrl+I"

        if self.is_rich_text_mode():
            title = _("Usage")
            tutorial_message = _("New to Spyder? Read our")
            tutorial = _("tutorial")
            intro_message = intro_message % ("<b>"+shortcut+"</b>", "<br><br>",
                                             "<i>"+prefs+"</i>")
            self.set_rich_text_html(usage(title, intro_message,
                                          tutorial_message, tutorial),
                                    QUrl.fromLocalFile(CSS_PATH))
        else:
            install_sphinx = "\n\n%s" % _("Please consider installing Sphinx "
                                          "to get documentation rendered in "
                                          "rich text.")
            intro_message = intro_message % (shortcut, "\n\n", prefs)
            intro_message += install_sphinx
            self.set_plain_text(intro_message, is_code=False)
开发者ID:dzosz,项目名称:spyder,代码行数:29,代码来源:help.py


示例3: _show_rich_help

 def _show_rich_help(self, text):
     """Use our Object Inspector to show IPython help texts in rich mode"""
     from spyderlib.utils.inspector import sphinxify as spx
     
     context = spx.generate_context(name='', argspec='', note='',
                                    math=False)
     html_text = spx.sphinxify(text, context)
     inspector = self.inspector
     inspector.visibility_changed(True)
     inspector.raise_()
     inspector.switch_to_rich_text()
     inspector.set_rich_text_html(html_text,
                                  QUrl.fromLocalFile(spx.CSS_PATH))
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:13,代码来源:ipythonconsole.py


示例4: _on_sphinx_thread_html_ready

 def _on_sphinx_thread_html_ready(self, html_text):
     """Set our sphinx documentation based on thread result"""
     self._sphinx_thread.wait()
     self.set_rich_text_html(html_text, QUrl.fromLocalFile(CSS_PATH))
开发者ID:dzosz,项目名称:spyder,代码行数:4,代码来源:help.py


示例5: sphinxify

             html_text = sphinxify(text)
         except Exception, error:
             import sphinx
             QMessageBox.critical(self,
                         _('Object inspector'),
                         _("The following error occured when calling "
                           "<b>Sphinx %s</b>. <br>Please check if this "
                           "version of Sphinx is supported by Spyder."
                           "<br><br>Error message:<br>%s"
                           ) % (sphinx.__version__, str(error)))
             self.plain_text_action.setChecked(True)
             return
     else:
         html_text = '<div id=\"warning\">'+self.no_doc_string+'</div>'
     html_text = HTML_HEAD + html_text + HTML_TAIL
     self.set_rich_text_html(html_text, QUrl.fromLocalFile(CSS_PATH))
     
 def show_help(self, obj_text, ignore_unknown=False):
     """Show help"""
     if self.shell is None:
         return
     self._check_if_shell_is_running()
     if self.shell is None:
         return
     obj_text = unicode(obj_text)
     
     if self.shell.is_defined(obj_text):
         shell = self.shell
     elif self.get_option('automatic_import') and \
          self.internal_shell.is_defined(obj_text, force_import=True):
         shell = self.internal_shell
开发者ID:jromang,项目名称:retina-old,代码行数:31,代码来源:inspector.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python QtGui.QApplication类代码示例发布时间:2022-05-27
下一篇:
Python QtCore.QTimer类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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