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


Python QTest.qWait方法代码示例

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


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

示例1: combobox_activate_index

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
    def combobox_activate_index(cbox, index, delay=-1):
        """
        Activate an item at `index` in a given combo box.

        The item at index **must** be enabled and selectable.

        Parameters
        ----------
        cbox : QComboBox
        index : int
        delay : int
            Run the event loop after the signals are emitted for `delay`
            milliseconds (-1, the default, means no delay).
        """
        assert 0 <= index < cbox.count()
        model = cbox.model()
        column = cbox.modelColumn()
        root = cbox.rootModelIndex()
        mindex = model.index(index, column, root)
        assert mindex.flags() & Qt.ItemIsEnabled
        cbox.setCurrentIndex(index)
        text = cbox.currentText()
        # QComboBox does not have an interface which would allow selecting
        # the current item as if a user would. Only setCurrentIndex which
        # does not emit the activated signals.
        cbox.activated[int].emit(index)
        cbox.activated[str].emit(text)
        if delay >= 0:
            QTest.qWait(delay)
开发者ID:PrimozGodec,项目名称:orange3,代码行数:31,代码来源:utils.py

示例2: test_label_overlap

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def test_label_overlap(self):
     self.send_signal(self.widget.Inputs.data, self.heart)
     self.widget.stretched = False
     self.__select_variable("chest pain")
     self.__select_group("gender")
     self.widget.show()
     QTest.qWait(3000)
     self.widget.hide()
开发者ID:randxie,项目名称:orange3,代码行数:10,代码来源:test_owboxplot.py

示例3: mouseMove

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
def mouseMove(widget, pos=QPoint(), delay=-1):  # pragma: no-cover
    # Like QTest.mouseMove, but functional without QCursor.setPos
    if pos.isNull():
        pos = widget.rect().center()
    me = QMouseEvent(QMouseEvent.MouseMove, pos, widget.mapToGlobal(pos),
                     Qt.NoButton, Qt.MouseButtons(0), Qt.NoModifier)
    if delay > 0:
        QTest.qWait(delay)

    QApplication.sendEvent(widget, me)
开发者ID:PrimozGodec,项目名称:orange3,代码行数:12,代码来源:utils.py

示例4: test_zoom_rect

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def test_zoom_rect(self):
     """ Test zooming with two clicks. """
     self.widget.show()
     qWaitForWindow(self.widget)
     self.send_signal("Data", self.iris)
     vb = self.widget.curveplot.plot.vb
     vb.set_mode_zooming()
     vr = vb.viewRect()
     QTest.qWait(100)
     tls = vr.bottomRight() if self.widget.curveplot.invertX else vr.bottomLeft()
     tl = vb.mapViewToScene(tls).toPoint() + QPoint(2, 2)
     br = vb.mapViewToScene(vr.center()).toPoint()
     tlw = vb.mapSceneToView(tl)
     brw = vb.mapSceneToView(br)
     ca = self.widget.curveplot.childAt(tl)
     QTest.mouseClick(ca, Qt.LeftButton, pos=tl)
     QTest.qWait(1)
     QTest.mouseMove(self.widget.curveplot, pos=tl)
     QTest.qWait(1)
     QTest.mouseMove(self.widget.curveplot)
     QTest.qWait(1)
     QTest.mouseClick(ca, Qt.LeftButton, pos=br)
     vr = vb.viewRect()
     self.assertAlmostEqual(vr.bottom(), tlw.y())
     self.assertAlmostEqual(vr.top(), brw.y())
     if self.widget.curveplot.invertX:
         self.assertAlmostEqual(vr.right(), tlw.x())
         self.assertAlmostEqual(vr.left(), brw.x())
     else:
         self.assertAlmostEqual(vr.left(), tlw.x())
         self.assertAlmostEqual(vr.right(), brw.x())
     self.widget.hide()
开发者ID:stuart-cls,项目名称:orange-infrared,代码行数:34,代码来源:test_owspectra.py

示例5: select_diagonal

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def select_diagonal(self):
     vb = self.widget.curveplot.plot.vb
     vb.set_mode_select()
     vr = vb.viewRect()
     tls = vr.bottomRight() if self.widget.curveplot.invertX else vr.bottomLeft()
     brs = vr.topLeft() if self.widget.curveplot.invertX else vr.topRight()
     tl = vb.mapViewToScene(tls).toPoint() + QPoint(2, 100)  # avoid menu button
     br = vb.mapViewToScene(brs).toPoint() - QPoint(2, 2)
     ca = self.widget.curveplot.childAt(tl)
     QTest.mouseClick(ca, Qt.LeftButton, pos=tl)
     self.widget.curveplot.plot.scene().sigMouseMoved.emit(tl)
     self.widget.curveplot.plot.scene().sigMouseMoved.emit(tl + QPoint(10, 10))
     QTest.qWait(1)
     QTest.mouseClick(ca, Qt.LeftButton, pos=br)
开发者ID:markotoplak,项目名称:orange-infrared,代码行数:16,代码来源:test_owspectra.py

示例6: _update_integration_type

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def _update_integration_type(self):
     self.line1.hide()
     self.line2.hide()
     self.line3.hide()
     if self.value_type == 0:
         self.box_values_spectra.setDisabled(False)
         self.box_values_feature.setDisabled(True)
         if self.integration_methods[self.integration_method] != Integrate.PeakAt:
             self.line1.show()
             self.line2.show()
         else:
             self.line3.show()
     elif self.value_type == 1:
         self.box_values_spectra.setDisabled(True)
         self.box_values_feature.setDisabled(False)
     QTest.qWait(1)  # first update the interface
开发者ID:markotoplak,项目名称:orange-infrared,代码行数:18,代码来源:owhyper.py

示例7: do_zoom_rect

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def do_zoom_rect(self, invertX):
     """ Test zooming with two clicks. """
     self.send_signal("Data", self.iris)
     vb = self.widget.curveplot.plot.vb
     self.widget.curveplot.invertX = invertX
     self.widget.curveplot.invertX_apply()
     vb.set_mode_zooming()
     vr = vb.viewRect()
     tls = vr.bottomRight() if self.widget.curveplot.invertX else vr.bottomLeft()
     # move down to avoid clicking on the menu button
     tl = vb.mapViewToScene(tls).toPoint() + QPoint(0, 100)
     br = vb.mapViewToScene(vr.center()).toPoint()
     tlw = vb.mapSceneToView(tl)
     brw = vb.mapSceneToView(br)
     ca = self.widget.curveplot.childAt(tl)
     QTest.mouseClick(ca, Qt.LeftButton, pos=tl)
     QTest.qWait(1)
     self.widget.curveplot.plot.scene().sigMouseMoved.emit(tl)
     QTest.qWait(1)
     self.widget.curveplot.plot.scene().sigMouseMoved.emit(tl + QPoint(10, 10))
     QTest.qWait(1)
     QTest.mouseClick(ca, Qt.LeftButton, pos=br)
     vr = vb.viewRect()
     self.assertAlmostEqual(vr.bottom(), tlw.y())
     self.assertAlmostEqual(vr.top(), brw.y())
     if self.widget.curveplot.invertX:
         self.assertAlmostEqual(vr.right(), tlw.x())
         self.assertAlmostEqual(vr.left(), brw.x())
     else:
         self.assertAlmostEqual(vr.left(), tlw.x())
         self.assertAlmostEqual(vr.right(), brw.x())
开发者ID:markotoplak,项目名称:orange-infrared,代码行数:33,代码来源:test_owspectra.py

示例8: test_search

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
    def test_search(self):
        registry = QtWidgetRegistry(small_testing_registry())

        menu = SuggestMenuPage()

        menu.setModel(registry.model())
        menu.show()
        menu.setFilterFixedString("o")
        QTest.qWait(10)
        menu.setFilterFixedString("z")
        QTest.qWait(10)
        menu.setFilterFixedString("m")
        QTest.qWait(10)
开发者ID:ales-erjavec,项目名称:orange-canvas,代码行数:15,代码来源:test_quickmenu.py

示例9: tearDownClass

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def tearDownClass(cls):
     QTest.qWait(40)
     cls.app = None
开发者ID:biolab,项目名称:orange3-imageanalytics,代码行数:5,代码来源:test_owimageimport.py

示例10: tearDown

# 需要导入模块: from AnyQt.QtTest import QTest [as 别名]
# 或者: from AnyQt.QtTest.QTest import qWait [as 别名]
 def tearDown(self):
     QTest.qWait(10)
     super(QAppTestCase, self).tearDown()
开发者ID:ales-erjavec,项目名称:orange-canvas,代码行数:5,代码来源:test.py


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