def mouseMove(self, widget, pos=None, delay=-1): """Simulate moving the mouse. See QTest.mouseMove for details. """ pos = qt.QPoint(int(pos[0]), int( pos[1])) if pos is not None else qt.QPoint() QTest.mouseMove(widget, pos, delay) self.qWait(20)
def _dragSelectActiveView(self): ''' Helper that drags-select (region-select) the whole viewport. ''' view = OMUI.M3dView.active3dView() viewWidget = wrapInstance(int(view.widget()), QWidget) viewWidget.update() self._processViewEvents() QTest.mousePress(viewWidget, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier, viewWidget.rect().topLeft() + QtCore.QPoint(1, 1)) QTest.mouseMove(viewWidget, viewWidget.rect().bottomRight() - QtCore.QPoint(1,1)) QTest.mouseRelease(viewWidget, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier, viewWidget.rect().bottomRight() - QtCore.QPoint(1, 1))