128 const QPoint pressPoint(verticalScrollBar->width() / 2, verticalScrollBar->height() - 10); |
128 const QPoint pressPoint(verticalScrollBar->width() / 2, verticalScrollBar->height() - 10); |
129 const QPoint globalPressPoint = verticalScrollBar->mapToGlobal(globalPressPoint); |
129 const QPoint globalPressPoint = verticalScrollBar->mapToGlobal(globalPressPoint); |
130 QMouseEvent mousePressEvent(QEvent::MouseButtonPress, pressPoint, globalPressPoint, |
130 QMouseEvent mousePressEvent(QEvent::MouseButtonPress, pressPoint, globalPressPoint, |
131 Qt::LeftButton, Qt::LeftButton, 0); |
131 Qt::LeftButton, Qt::LeftButton, 0); |
132 QApplication::sendEvent(verticalScrollBar, &mousePressEvent); |
132 QApplication::sendEvent(verticalScrollBar, &mousePressEvent); |
133 QTest::qWait(50); |
133 QTest::qWait(1); |
134 QMouseEvent mouseReleaseEvent(QEvent::MouseButtonRelease, pressPoint, globalPressPoint, |
134 QMouseEvent mouseReleaseEvent(QEvent::MouseButtonRelease, pressPoint, globalPressPoint, |
135 Qt::LeftButton, Qt::LeftButton, 0); |
135 Qt::LeftButton, Qt::LeftButton, 0); |
136 QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent); |
136 QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent); |
137 |
137 |
138 // Check that the action was triggered once. |
138 // Check that the action was triggered once. |