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

Python qthelpers.qapplication函数代码示例

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

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



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

示例1: setup_editor

def setup_editor(qtbot, monkeypatch):
    """Set up the Editor plugin."""
    qapplication()
    from spyder.plugins.editor.plugin import Editor

    monkeypatch.setattr('spyder.plugins.editor.plugin.add_actions', Mock())

    class MainMock(QWidget):
        def __getattr__(self, attr):
            if attr.endswith('actions'):
                return []
            elif attr == 'projects':
                projects = Mock()
                projects.get_active_project.return_value = None
                return projects
            else:
                return Mock()

        def get_spyder_pythonpath(*args):
            return []

    editor = Editor(MainMock())
    qtbot.addWidget(editor)
    editor.show()

    yield editor, qtbot
开发者ID:burrbull,项目名称:spyder,代码行数:26,代码来源:test_plugin.py


示例2: test

def test():        
    """Local test."""
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    dlg = ProjectDialog(None)
    dlg.show()
    sys.exit(app.exec_())
开发者ID:burrbull,项目名称:spyder,代码行数:7,代码来源:projectdialog.py


示例3: test

def test(text):
    """Test"""
    from spyder.utils.qthelpers import qapplication
    _app = qapplication()  # analysis:ignore
    dialog = ImportWizard(None, text)
    if dialog.exec_():
        print(dialog.get_data())
开发者ID:ShenggaoZhu,项目名称:spyder,代码行数:7,代码来源:importwizard.py


示例4: test

def test():
    """Run breakpoint widget test"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    widget = BreakpointWidget(None)
    widget.show()
    sys.exit(app.exec_())
开发者ID:0xBADCA7,项目名称:spyder,代码行数:7,代码来源:breakpointsgui.py


示例5: construct_editor

def construct_editor(qtbot, *args, **kwargs):
    os.environ['SPY_TEST_USE_INTROSPECTION'] = 'True'
    app = qapplication()
    lsp_manager = LSPManager(parent=None)
    editor = CodeEditor(parent=None)
    kwargs['language'] = 'Python'
    editor.setup_editor(*args, **kwargs)
    wrapper = LSPEditorWrapper(None, editor, lsp_manager)

    lsp_manager.register_plugin_type(
        LSPEventTypes.DOCUMENT, wrapper.sig_initialize)
    with qtbot.waitSignal(wrapper.sig_initialize, timeout=30000):
        editor.filename = 'test.py'
        editor.language = 'Python'
        lsp_manager.start_lsp_client('python')

    text = ("def some_function():\n"  # D100, D103: Missing docstring
            "    \n"  # W293 trailing spaces
            "    a = 1 # a comment\n"  # E261 two spaces before inline comment
            "\n"
            "    a += s\n"  # Undefined variable s
            "    return a\n"
            )
    editor.set_text(text)
    with qtbot.waitSignal(editor.lsp_response_signal, timeout=30000):
        editor.document_did_open()

    yield editor, lsp_manager
    os.environ['SPY_TEST_USE_INTROSPECTION'] = 'False'
    lsp_manager.closing_plugin()
开发者ID:burrbull,项目名称:spyder,代码行数:30,代码来源:test_warnings.py


示例6: setup_editor

def setup_editor(qtbot, monkeypatch):
    """Set up the Editor plugin."""
    app = qapplication()
    os.environ['SPY_TEST_USE_INTROSPECTION'] = 'True'
    monkeypatch.setattr('spyder.dependencies', Mock())
    from spyder.plugins.editor import Editor

    monkeypatch.setattr('spyder.plugins.editor.add_actions', Mock())

    class MainMock(QWidget):
        def __getattr__(self, attr):
            if attr.endswith('actions'):
                return []
            else:
                return Mock()

        def get_spyder_pythonpath(*args):
            return []

    editor = Editor(MainMock())
    qtbot.addWidget(editor)
    editor.show()
    editor.new(fname="test.py", text="")
    editor.introspector.set_editor_widget(editor.editorstacks[0])

    yield editor, qtbot
    # teardown
    os.environ['SPY_TEST_USE_INTROSPECTION'] = 'False'
    editor.introspector.plugin_manager.close()
开发者ID:0xBADCA7,项目名称:spyder,代码行数:29,代码来源:test_editor_introspection.py


示例7: test

def test():
    """Run history widget."""
    from spyder.utils.qthelpers import qapplication
    app = qapplication(test_time=8)
    widget = History(None)
    widget.show()
    sys.exit(app.exec_())
开发者ID:burrbull,项目名称:spyder,代码行数:7,代码来源:widgets.py


示例8: test

def test():
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    test = ProjectExplorerTest()
    test.resize(250, 480)
    test.show()
    app.exec_()
开发者ID:0xBADCA7,项目名称:spyder,代码行数:7,代码来源:explorer.py


示例9: test

def test():
    """Run path manager test"""
    from spyder.utils.qthelpers import qapplication
    _app = qapplication()  # analysis:ignore
    test = PathManager(None, pathlist=sys.path[:-10],
                       ro_pathlist=sys.path[-10:])
    test.exec_()
    print(test.get_path_list())  # spyder: test-skip
开发者ID:rlaverde,项目名称:spyder,代码行数:8,代码来源:pathmanager.py


示例10: test

def test():
    """Run web browser"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication(test_time=8)
    widget = PydocBrowser(None)
    widget.show()
    widget.initialize()
    sys.exit(app.exec_())
开发者ID:cfanpc,项目名称:spyder,代码行数:8,代码来源:widgets.py


示例11: test

def test():
    """Run Find in Files widget test"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    widget = FindInFilesWidget(None)
    widget.resize(640, 480)
    widget.show()
    sys.exit(app.exec_())
开发者ID:rlaverde,项目名称:spyder,代码行数:8,代码来源:findinfiles.py


示例12: test

def test():  # pragma: no cover
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    dlg_table = NumpyArrayDialog(None, inline=False)
    dlg_inline = NumpyArrayDialog(None, inline=True)
    dlg_table.show()
    dlg_inline.show()
    app.exec_()
开发者ID:ShenggaoZhu,项目名称:spyder,代码行数:8,代码来源:arraybuilder.py


示例13: test

def test():
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    table = ShortcutsTable()
    table.show()
    app.exec_()
    print([str(s) for s in table.source_model.shortcuts])  # spyder: test-skip
    table.check_shortcuts()
开发者ID:0xBADCA7,项目名称:spyder,代码行数:8,代码来源:shortcuts.py


示例14: test

def test():
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    table = ShortcutsTable()
    table.show()
    app.exec_()

    table.check_shortcuts()
开发者ID:impact27,项目名称:spyder,代码行数:8,代码来源:shortcuts.py


示例15: test

def test():
    """Run web browser"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication(test_time=8)
    widget = WebBrowser()
    widget.show()
    widget.set_home_url('http://www.google.com/')
    widget.go_home()
    sys.exit(app.exec_())
开发者ID:silentquasar,项目名称:spyder,代码行数:9,代码来源:browser.py


示例16: test

def test():
    """Run pylint widget test"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication(test_time=20)
    widget = PylintWidget(None)
    widget.resize(640, 480)
    widget.show()
    widget.analyze(__file__)
    sys.exit(app.exec_())
开发者ID:rlaverde,项目名称:spyder,代码行数:9,代码来源:pylintgui.py


示例17: editor_close_quotes

def editor_close_quotes():
    """Set up Editor with close quotes activated."""
    app = qapplication()
    editor = CodeEditor(parent=None)
    kwargs = {}
    kwargs['language'] = 'Python'
    kwargs['close_quotes'] = True
    editor.setup_editor(**kwargs)
    return editor
开发者ID:0xBADCA7,项目名称:spyder,代码行数:9,代码来源:test_closequotes.py


示例18: test

def test():
    """Run widget test"""
    from spyder.utils.qthelpers import qapplication
    app = qapplication()
    widget = UnitTestingWidget(None)
    widget.resize(800, 600)
    widget.show()
    widget.analyze(osp.normpath(osp.join(osp.dirname(__file__), osp.pardir)))
    sys.exit(app.exec_())
开发者ID:spyder-ide,项目名称:spyder.unittest,代码行数:9,代码来源:unittestinggui.py


示例19: construct_editor

def construct_editor(text):
    app = qapplication()
    editor = CodeEditor(parent=None)
    editor.setup_editor(language='Python')
    editor.set_text(text)
    cursor = editor.textCursor()
    cursor.movePosition(QTextCursor.End)
    editor.setTextCursor(cursor)
    return editor
开发者ID:burrbull,项目名称:spyder,代码行数:9,代码来源:test_autocolon.py


示例20: editor_auto_docstring

def editor_auto_docstring():
    """Set up Editor with auto docstring activated."""
    app = qapplication()
    editor = CodeEditor(parent=None)
    kwargs = {}
    kwargs['language'] = 'Python'
    kwargs['close_quotes'] = True
    kwargs['close_parentheses'] = True
    editor.setup_editor(**kwargs)
    return editor
开发者ID:impact27,项目名称:spyder,代码行数:10,代码来源:test_docstring.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python findreplace.FindReplace类代码示例发布时间:2022-05-27
下一篇:
Python qthelpers.create_toolbutton函数代码示例发布时间: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