本文整理汇总了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)
示例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