当前位置: 首页>>代码示例>>Python>>正文


Python QTest.qWait方法代码示例

本文整理汇总了Python中pyqode.qt.QtTest.QTest.qWait方法的典型用法代码示例。如果您正苦于以下问题:Python QTest.qWait方法的具体用法?Python QTest.qWait怎么用?Python QTest.qWait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqode.qt.QtTest.QTest的用法示例。


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

示例1: test_selected_text

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_selected_text(editor):
    helper = TextHelper(editor)
    helper.goto_line(2, 1, move=True)
    QTest.qWait(100)
    assert helper.word_under_cursor().selectedText() == 'T'
    assert helper.word_under_cursor(
        select_whole_word=True).selectedText() == 'This'
开发者ID:dtonal,项目名称:pyqode.core,代码行数:9,代码来源:test_text.py

示例2: test_json_code_edit

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_json_code_edit():
    editor = JSONCodeEdit()
    editor.file.open('test/files/example.json')
    QTest.qWait(1000)
    assert editor.backend.running
    editor.close()
    assert not editor.backend.running
开发者ID:pyQode,项目名称:pyqode.json,代码行数:9,代码来源:test_code_edit.py

示例3: test_add_marker

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_add_marker(editor):
    panel = get_panel(editor)
    marker = panels.Marker(1, icon=':/pyqode-icons/rc/edit-undo.png',
                           description='Marker description')
    panel.add_marker(marker)
    QTest.qWait(500)
    assert panel.marker_for_line(1)[0] is not None
开发者ID:dtonal,项目名称:pyqode.core,代码行数:9,代码来源:test_marker.py

示例4: editor

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def editor(request):
    import gettext
    gettext.NullTranslations().install()
    global _app, _widget
    from pyqode.core import modes
    from pyqode.cobol.widgets import CobolCodeEdit
    from pyqode.qt.QtTest import QTest

    logging.info('################ setup session editor ################')

    _widget = CobolCodeEdit()
    _widget.resize(800, 600)
    _widget.show()
    _app.setActiveWindow(_widget)
    while not _widget.backend.connected:
        QTest.qWait(100)

    _widget.modes.get(modes.FileWatcherMode).file_watcher_auto_reload = True
    _widget.save_on_focus_out = False

    def fin():
        global _widget
        logging.info('################ teardown session editor ###############'
                     '#')
        _widget.backend.stop()
        while _widget.backend.connected:
            QTest.qWait(100)
        del _widget

    request.addfinalizer(fin)

    return _widget
开发者ID:emmanuelgrognet,项目名称:pyqode.cobol,代码行数:34,代码来源:conftest.py

示例5: test_key_pressed

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_key_pressed():
    # " -> ""
    editor = CodeEdit()
    editor.modes.append(modes.AutoCompleteMode())
    editor.setPlainText('', '', 'utf-8')
    QTest.keyPress(editor, '"')
    assert editor.toPlainText() == '""'
    editor.clear()

    # if a " already exists, cursor should just move after " and a new " should
    # not be inserted
    editor.setPlainText('"', 'text/x-python', 'utf-8')
    TextHelper(editor).goto_line(0, 0)
    QTest.keyPress(editor, '"')
    assert editor.toPlainText() == '"'
    editor.clear()

    # if a ) already exists, cursor should just move after ) and a new ) should
    # not be inserted
    editor.setPlainText(')', 'text/x-python', 'utf-8')
    TextHelper(editor).goto_line(0, 0)
    QTest.keyPress(editor, ')')
    QTest.qWait(1000)
    assert editor.toPlainText() == ')'

    # ] should be inserted ")" -> "])"
    TextHelper(editor).goto_line(0, 0)
    QTest.keyPress(editor, ']')
    QTest.qWait(1000)
    assert editor.toPlainText() == '])'
开发者ID:SirmoGames,项目名称:pyqode.core,代码行数:32,代码来源:test_autocomplete.py

示例6: test_request_search

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_request_search(editor):
    QTest.qWait(1000)
    assert editor.backend.running
    panel = get_panel(editor)
    panel.request_search('import')
    QTest.qWait(2000)
    assert panel.cpt_occurences > 1
开发者ID:must40,项目名称:pyqode.core,代码行数:9,代码来源:test_search_and_replace.py

示例7: toggle_fold_trigger

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def toggle_fold_trigger(editor, line, panel):
    y_pos = TextHelper(editor).line_pos_from_number(line) + 5
    QTest.mouseMove(panel, QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
    QTest.mousePress(panel, QtCore.Qt.RightButton, QtCore.Qt.NoModifier,
                     QtCore.QPoint(3, y_pos))
    QTest.qWait(1000)
开发者ID:must40,项目名称:pyqode.core,代码行数:9,代码来源:test_folding.py

示例8: test_goto_definition

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_goto_definition(editor):
    editor.show()
    QTest.qWait(1000)
    panel = get_panel(editor)
    line = TextHelper(editor).current_line_nbr()
    panel._on_definition_activated(len(panel._definitions) - 2)
    assert TextHelper(editor).current_line_nbr() != line
开发者ID:SirmoGames,项目名称:pyqode.python,代码行数:9,代码来源:test_symbol_browser.py

示例9: editor

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def editor(request):
    global _app, _widget
    from pyqode.core import modes, cache
    from pyqode.python.widgets.code_edit import PyCodeEdit
    from pyqode.python.panels import SymbolBrowserPanel
    from pyqode.qt.QtTest import QTest

    cache.Cache().clear()

    _widget = PyCodeEdit()
    _widget.panels.append(SymbolBrowserPanel(),
                          SymbolBrowserPanel.Position.TOP)
    _widget.resize(800, 600)

    while not _widget.backend.connected:
        QTest.qWait(100)

    _widget.modes.get(modes.FileWatcherMode).file_watcher_auto_reload = True
    _widget.save_on_focus_out = False

    def fin():
        global _widget
        _widget.close()
        del _widget

    request.addfinalizer(fin)
    return _widget
开发者ID:SirmoGames,项目名称:pyqode.python,代码行数:29,代码来源:conftest.py

示例10: test_line_nbr_from_position

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_line_nbr_from_position(editor):
    editor.repaint()
    sys.stderr.write(str(editor.visible_blocks))
    assert TextHelper(editor).line_nbr_from_position(
        TextHelper(editor).line_pos_from_number(0)) is not None
    assert TextHelper(editor).line_nbr_from_position(-1) == 0
    QTest.qWait(100)
开发者ID:dtonal,项目名称:pyqode.core,代码行数:9,代码来源:test_text.py

示例11: test_json_code_edit

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_json_code_edit():
    editor = RstCodeEdit()
    editor.file.open('test/files/demo_ko.rst')
    QTest.qWait(1000)
    assert editor.backend.running
    editor.close()
    assert not editor.backend.running
开发者ID:SirmoGames,项目名称:pyqode.rst,代码行数:9,代码来源:test_code_edit.py

示例12: editor

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def editor(request):
    global _app, _widget
    from pyqode.core import modes
    from pyqode.rst.widgets import RstCodeEdit
    from pyqode.qt.QtTest import QTest

    logging.info('################ setup session editor ################')

    _widget = RstCodeEdit()
    _widget.resize(800, 600)
    _app.setActiveWindow(_widget)
    while not _widget.backend.connected:
        QTest.qWait(100)

    _widget.modes.get(modes.FileWatcherMode).file_watcher_auto_reload = True
    _widget.save_on_focus_out = False

    def fin():
        global _widget
        _widget.close()
        while _widget.backend.connected:
            QTest.qWait(100)
        del _widget

    request.addfinalizer(fin)

    return _widget
开发者ID:SirmoGames,项目名称:pyqode.rst,代码行数:29,代码来源:conftest.py

示例13: test_style

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_style(editor):
    panel = get_panel(editor)
    panel.request_search('import')
    QTest.qWait(1000)
    panel.background = QtGui.QColor('green')
    panel.foreground = QtGui.QColor('red')
    QTest.qWait(1000)
开发者ID:pyQode,项目名称:pyqode.core,代码行数:9,代码来源:test_search_and_replace.py

示例14: test_select_lines

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_select_lines(editor):
    TextHelper(editor).select_lines(0, 4)
    QTest.qWait(100)
    QTest.qWait(1000)
    assert TextHelper(editor).selection_range() == (0, 4)
    TextHelper(editor).select_lines(-1, 10)
    assert TextHelper(editor).selection_range() == (0, 10)
    editor.decorations.clear()
开发者ID:dtonal,项目名称:pyqode.core,代码行数:10,代码来源:test_text.py

示例15: test_close

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWait [as 别名]
def test_close(editor):
    panel = get_panel(editor)
    panel.on_actionSearch_triggered()
    assert panel.isVisible()
    panel.on_toolButtonClose_clicked()
    assert not panel.isVisible()
    QTest.qWait(100)
    panel.on_actionSearch_triggered()
开发者ID:must40,项目名称:pyqode.core,代码行数:10,代码来源:test_search_and_replace.py


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