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


Python QTest.qWaitForWindowActive方法代码示例

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


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

示例1: test_modif_without_focus

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWaitForWindowActive [as 别名]
def test_modif_without_focus(editor):
    mode = get_mode(editor)
    mode.auto_reload = False
    win = QtWidgets.QMainWindow()
    win.show()
    QTest.qWaitForWindowActive(win)
    with open(file_path, 'r') as f:
        with open(file_path, 'w') as f2:
            f2.write("test file %s" % datetime.datetime.now())
    QtCore.QTimer.singleShot(1500, accept_mbox)
    # wait for the filewatcher to detect the changed
    QTest.qWait(500)
    QtWidgets.QApplication.instance().setActiveWindow(editor)
    # wait for the message box to appear
    QTest.qWait(500)
开发者ID:dtonal,项目名称:pyqode.core,代码行数:17,代码来源:test_filewatcher.py

示例2: test_margin_size

# 需要导入模块: from pyqode.qt.QtTest import QTest [as 别名]
# 或者: from pyqode.qt.QtTest.QTest import qWaitForWindowActive [as 别名]
def test_margin_size(editor):
    for panel in editor.panels:
        panel.enabled = False
        panel.hide()

    # we really need to show the window here to get correct margin size.
    editor.show()
    QTest.qWaitForWindowActive(editor)
    for position in Panel.Position.iterable():
        # there is no panel on this widget, all margin must be 0
        assert editor.panels.margin_size(position) == 0
    panel = panels.LineNumberPanel()
    editor.panels.append(panel, position=panel.Position.LEFT)
    panel.setVisible(True)
    QTest.qWait(300)
    # as the window is not visible, we need to refresh panels manually
    assert editor.panels.margin_size(Panel.Position.LEFT) != 0
    for panel in editor.panels:
        panel.enabled = True
开发者ID:SirmoGames,项目名称:pyqode.core,代码行数:21,代码来源:test_code_edit.py


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