| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2021 Steffen Hartleib <[email protected]> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | */ |
| 7 | |
| 8 | #include <ktwofingerswipe.h> |
| 9 | |
| 10 | #include <QMainWindow> |
| 11 | #include <QSignalSpy> |
| 12 | #include <QTest> |
| 13 | #include <QWidget> |
| 14 | |
| 15 | #include "windowscheck.h" |
| 16 | |
| 17 | class KTwoFingerSwipeTest : public QObject |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | |
| 21 | QPointingDevice *mDev = nullptr; |
| 22 | |
| 23 | QMainWindow mMainWindow; |
| 24 | QWidget mWidget; |
| 25 | KTwoFingerSwipeRecognizer *mTwoFingerRec = nullptr; |
| 26 | Qt::GestureType mKTwoFingerSwipeGesture; |
| 27 | QPoint mTouchPointPos = QPoint(200, 200); |
| 28 | QSignalSpy *mSpySwipeFinished = nullptr; |
| 29 | QSignalSpy *mSpySwipeStarted = nullptr; |
| 30 | QSignalSpy *mSpySwipeUpdated = nullptr; |
| 31 | QSignalSpy *mSpySwipeCanceled = nullptr; |
| 32 | qreal mAngel = 0.0; |
| 33 | |
| 34 | Q_SIGNALS: |
| 35 | void swipeStarted(KTwoFingerSwipe *); |
| 36 | void swipeFinished(KTwoFingerSwipe *); |
| 37 | void swipeUpdated(KTwoFingerSwipe *); |
| 38 | void swipeCanceled(KTwoFingerSwipe *); |
| 39 | |
| 40 | protected: |
| 41 | bool eventFilter(QObject *watched, QEvent *e) override |
| 42 | { |
| 43 | if (e->type() == QEvent::Gesture) { |
| 44 | QGestureEvent *gEvent = static_cast<QGestureEvent *>(e); |
| 45 | KTwoFingerSwipe *swipe = static_cast<KTwoFingerSwipe *>(gEvent->gesture(mKTwoFingerSwipeGesture)); |
| 46 | if (swipe) { |
| 47 | const Qt::GestureState state = swipe->state(); |
| 48 | if (state == Qt::GestureFinished) { |
| 49 | Q_EMIT swipeFinished(swipe); |
| 50 | } else if (state == Qt::GestureStarted) { |
| 51 | Q_EMIT swipeStarted(swipe); |
| 52 | } else if (state == Qt::GestureUpdated) { |
| 53 | Q_EMIT swipeUpdated(swipe); |
| 54 | } else if (state == Qt::GestureCanceled) { |
| 55 | Q_EMIT swipeCanceled(swipe); |
| 56 | } |
| 57 | } |
| 58 | e->accept(); |
| 59 | return true; |
| 60 | } |
| 61 | return QObject::eventFilter(watched, e); |
| 62 | } |
| 63 | |
| 64 | protected Q_SLOTS: |
| 65 | void slotSwipeFinished(KTwoFingerSwipe *swipe) |
| 66 | { |
| 67 | compareGesturePositions(swipe); |
| 68 | } |
| 69 | void slotSwipeStarted(KTwoFingerSwipe *swipe) |
| 70 | { |
| 71 | compareGesturePositions(swipe); |
| 72 | } |
| 73 | void slotSwipeUpdated(KTwoFingerSwipe *swipe) |
| 74 | { |
| 75 | compareGesturePositions(swipe); |
| 76 | } |
| 77 | void slotSwipeCanceled(KTwoFingerSwipe *swipe) |
| 78 | { |
| 79 | compareGesturePositions(swipe); |
| 80 | } |
| 81 | |
| 82 | private: |
| 83 | void compareGesturePositions(KTwoFingerSwipe *swipe) |
| 84 | { |
| 85 | QCOMPARE(swipe->pos(), mTouchPointPos); |
| 86 | QCOMPARE(swipe->screenPos(), mWidget.mapToGlobal(mTouchPointPos)); |
| 87 | QCOMPARE(swipe->hotSpot(), mWidget.mapToGlobal(mTouchPointPos)); |
| 88 | QCOMPARE(swipe->scenePos(), mWidget.mapToGlobal(mTouchPointPos)); |
| 89 | QVERIFY(swipe->hasHotSpot()); |
| 90 | mAngel = swipe->swipeAngle(); |
| 91 | } |
| 92 | |
| 93 | void clearSignalSpys() |
| 94 | { |
| 95 | mSpySwipeFinished->clear(); |
| 96 | mSpySwipeCanceled->clear(); |
| 97 | mSpySwipeUpdated->clear(); |
| 98 | mSpySwipeStarted->clear(); |
| 99 | } |
| 100 | |
| 101 | private Q_SLOTS: |
| 102 | void cleanupTestCase() |
| 103 | { |
| 104 | delete mSpySwipeFinished; |
| 105 | delete mSpySwipeCanceled; |
| 106 | delete mSpySwipeUpdated; |
| 107 | delete mSpySwipeStarted; |
| 108 | delete mDev; |
| 109 | } |
| 110 | void initTestCase() |
| 111 | { |
| 112 | if (isWindowsCI()) { |
| 113 | QSKIP("GUI Tests on Windows CI are not supported"); |
| 114 | } |
| 115 | |
| 116 | mDev = QTest::createTouchDevice(); |
| 117 | |
| 118 | mMainWindow.setGeometry(0, 0, 500, 500); |
| 119 | mMainWindow.setCentralWidget(&mWidget); |
| 120 | mMainWindow.show(); |
| 121 | |
| 122 | mWidget.installEventFilter(this); |
| 123 | mWidget.setAttribute(Qt::WA_AcceptTouchEvents); |
| 124 | |
| 125 | QVERIFY(QTest::qWaitForWindowActive(&mMainWindow)); |
| 126 | QVERIFY(QTest::qWaitForWindowActive(&mWidget)); |
| 127 | |
| 128 | mTwoFingerRec = new KTwoFingerSwipeRecognizer(); |
| 129 | QVERIFY(mTwoFingerRec); |
| 130 | |
| 131 | mKTwoFingerSwipeGesture = QGestureRecognizer::registerRecognizer(mTwoFingerRec); |
| 132 | QVERIFY(mKTwoFingerSwipeGesture & Qt::CustomGesture); |
| 133 | |
| 134 | mWidget.grabGesture(mKTwoFingerSwipeGesture); |
| 135 | |
| 136 | connect(this, &KTwoFingerSwipeTest::swipeFinished, this, &KTwoFingerSwipeTest::slotSwipeFinished); |
| 137 | connect(this, &KTwoFingerSwipeTest::swipeStarted, this, &KTwoFingerSwipeTest::slotSwipeStarted); |
| 138 | connect(this, &KTwoFingerSwipeTest::swipeUpdated, this, &KTwoFingerSwipeTest::slotSwipeUpdated); |
| 139 | connect(this, &KTwoFingerSwipeTest::swipeCanceled, this, &KTwoFingerSwipeTest::slotSwipeCanceled); |
| 140 | |
| 141 | mSpySwipeFinished = new QSignalSpy(this, &KTwoFingerSwipeTest::swipeFinished); |
| 142 | QVERIFY(mSpySwipeFinished->isValid()); |
| 143 | |
| 144 | mSpySwipeStarted = new QSignalSpy(this, &KTwoFingerSwipeTest::swipeStarted); |
| 145 | QVERIFY(mSpySwipeStarted->isValid()); |
| 146 | |
| 147 | mSpySwipeUpdated = new QSignalSpy(this, &KTwoFingerSwipeTest::swipeUpdated); |
| 148 | QVERIFY(mSpySwipeUpdated->isValid()); |
| 149 | |
| 150 | mSpySwipeCanceled = new QSignalSpy(this, &KTwoFingerSwipeTest::swipeCanceled); |
| 151 | QVERIFY(mSpySwipeCanceled->isValid()); |
| 152 | |
| 153 | QTest::qWait(1000); |
| 154 | } |
| 155 | |
| 156 | void testChangeTimeAndDistance() |
| 157 | { |
| 158 | QVERIFY(mTwoFingerRec->maxSwipeTime() >= 0); |
| 159 | mTwoFingerRec->setMaxSwipeTime(10); |
| 160 | QCOMPARE(mTwoFingerRec->maxSwipeTime(), 10); |
| 161 | mTwoFingerRec->setMaxSwipeTime(-10); |
| 162 | QCOMPARE(mTwoFingerRec->maxSwipeTime(), 0); |
| 163 | mTwoFingerRec->setMaxSwipeTime(90); |
| 164 | QCOMPARE(mTwoFingerRec->maxSwipeTime(), 90); |
| 165 | |
| 166 | QVERIFY(mTwoFingerRec->minSswipeDistance() >= 0); |
| 167 | mTwoFingerRec->setSwipeDistance(10); |
| 168 | QCOMPARE(mTwoFingerRec->minSswipeDistance(), 10); |
| 169 | mTwoFingerRec->setSwipeDistance(-10); |
| 170 | QCOMPARE(mTwoFingerRec->minSswipeDistance(), 0); |
| 171 | mTwoFingerRec->setSwipeDistance(30); |
| 172 | QCOMPARE(mTwoFingerRec->minSswipeDistance(), 30); |
| 173 | } |
| 174 | |
| 175 | void testSuccessfulGesture_right() |
| 176 | { |
| 177 | clearSignalSpys(); |
| 178 | |
| 179 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 180 | const QPoint swipeDistance = QPoint(length, 0); |
| 181 | |
| 182 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 183 | |
| 184 | QTest::touchEvent(&mWidget, mDev) |
| 185 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 186 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 187 | |
| 188 | QTest::touchEvent(&mWidget, mDev) |
| 189 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 190 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 191 | |
| 192 | QTest::touchEvent(&mWidget, mDev) |
| 193 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 194 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 195 | |
| 196 | QTest::touchEvent(&mWidget, mDev) |
| 197 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 198 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 199 | |
| 200 | if (mSpySwipeStarted->count() == 0) { |
| 201 | QVERIFY(mSpySwipeStarted->wait(1000)); |
| 202 | } |
| 203 | |
| 204 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 205 | QCOMPARE(mSpySwipeFinished->count(), 1); |
| 206 | QCOMPARE(mSpySwipeCanceled->count(), 0); |
| 207 | QVERIFY(mSpySwipeUpdated->count() > 0); |
| 208 | QCOMPARE(mAngel, 0); |
| 209 | } |
| 210 | |
| 211 | void testSuccessfulGesture_left() |
| 212 | { |
| 213 | clearSignalSpys(); |
| 214 | |
| 215 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 216 | const QPoint swipeDistance = QPoint(-length, 0); |
| 217 | |
| 218 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 219 | |
| 220 | QTest::touchEvent(&mWidget, mDev) |
| 221 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 222 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 223 | |
| 224 | QTest::touchEvent(&mWidget, mDev) |
| 225 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 226 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 227 | |
| 228 | QTest::touchEvent(&mWidget, mDev) |
| 229 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 230 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 231 | |
| 232 | QTest::touchEvent(&mWidget, mDev) |
| 233 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 234 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 235 | |
| 236 | if (mSpySwipeStarted->count() == 0) { |
| 237 | QVERIFY(mSpySwipeStarted->wait(1000)); |
| 238 | } |
| 239 | |
| 240 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 241 | QCOMPARE(mSpySwipeFinished->count(), 1); |
| 242 | QCOMPARE(mSpySwipeCanceled->count(), 0); |
| 243 | QVERIFY(mSpySwipeUpdated->count() > 0); |
| 244 | QCOMPARE(mAngel, 180); |
| 245 | } |
| 246 | |
| 247 | void testSuccessfulGesture_up() |
| 248 | { |
| 249 | clearSignalSpys(); |
| 250 | |
| 251 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 252 | const QPoint swipeDistance = QPoint(0, -length); |
| 253 | |
| 254 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 255 | |
| 256 | QTest::touchEvent(&mWidget, mDev) |
| 257 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 258 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 259 | |
| 260 | QTest::touchEvent(&mWidget, mDev) |
| 261 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 262 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 263 | |
| 264 | QTest::touchEvent(&mWidget, mDev) |
| 265 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 266 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 267 | |
| 268 | QTest::touchEvent(&mWidget, mDev) |
| 269 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 270 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 271 | |
| 272 | if (mSpySwipeStarted->count() == 0) { |
| 273 | QVERIFY(mSpySwipeStarted->wait(1000)); |
| 274 | } |
| 275 | |
| 276 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 277 | QCOMPARE(mSpySwipeFinished->count(), 1); |
| 278 | QCOMPARE(mSpySwipeCanceled->count(), 0); |
| 279 | QVERIFY(mSpySwipeUpdated->count() > 0); |
| 280 | QCOMPARE(mAngel, 90); |
| 281 | } |
| 282 | |
| 283 | void testSuccessfulGesture_down() |
| 284 | { |
| 285 | clearSignalSpys(); |
| 286 | |
| 287 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 288 | const QPoint swipeDistance = QPoint(0, length); |
| 289 | |
| 290 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 291 | |
| 292 | QTest::touchEvent(&mWidget, mDev) |
| 293 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 294 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 295 | |
| 296 | QTest::touchEvent(&mWidget, mDev) |
| 297 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 298 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 299 | |
| 300 | QTest::touchEvent(&mWidget, mDev) |
| 301 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 302 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 303 | |
| 304 | QTest::touchEvent(&mWidget, mDev) |
| 305 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 306 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 307 | |
| 308 | if (mSpySwipeStarted->count() == 0) { |
| 309 | QVERIFY(mSpySwipeStarted->wait(1000)); |
| 310 | } |
| 311 | |
| 312 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 313 | QCOMPARE(mSpySwipeFinished->count(), 1); |
| 314 | QCOMPARE(mSpySwipeCanceled->count(), 0); |
| 315 | QVERIFY(mSpySwipeUpdated->count() > 0); |
| 316 | QCOMPARE(mAngel, 270); |
| 317 | } |
| 318 | |
| 319 | void testFailingGesture_toSlow() |
| 320 | { |
| 321 | clearSignalSpys(); |
| 322 | |
| 323 | const int length = mTwoFingerRec->minSswipeDistance() / 3; |
| 324 | const QPoint swipeDistance = QPoint(length, 0); |
| 325 | |
| 326 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 327 | |
| 328 | QTest::touchEvent(&mWidget, mDev) |
| 329 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 330 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 331 | |
| 332 | QTest::touchEvent(&mWidget, mDev) |
| 333 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 334 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 335 | |
| 336 | QTest::touchEvent(&mWidget, mDev) |
| 337 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 338 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 339 | |
| 340 | QTest::touchEvent(&mWidget, mDev) |
| 341 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 342 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 343 | |
| 344 | if (mSpySwipeStarted->count() == 0) { |
| 345 | QVERIFY(mSpySwipeStarted->wait(1000)); |
| 346 | } |
| 347 | |
| 348 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 349 | QCOMPARE(mSpySwipeFinished->count(), 0); |
| 350 | QCOMPARE(mSpySwipeCanceled->count(), 1); |
| 351 | QVERIFY(mSpySwipeUpdated->count() > 0); |
| 352 | QCOMPARE(mAngel, 0); |
| 353 | } |
| 354 | |
| 355 | void testFailingGesture_threeFingers() |
| 356 | { |
| 357 | clearSignalSpys(); |
| 358 | |
| 359 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 360 | const QPoint swipeDistance = QPoint(length, 0); |
| 361 | |
| 362 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr).press(1, mTouchPointPos, (QWidget *)nullptr); |
| 363 | |
| 364 | QTest::touchEvent(&mWidget, mDev) |
| 365 | .move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr) |
| 366 | .move(1, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 367 | |
| 368 | QTest::touchEvent(&mWidget, mDev) |
| 369 | .move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 370 | .move(1, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr) |
| 371 | .press(2, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 372 | |
| 373 | QTest::touchEvent(&mWidget, mDev) |
| 374 | .move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 375 | .move(1, mTouchPointPos + swipeDistance, (QWidget *)nullptr) |
| 376 | .move(2, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 377 | |
| 378 | QTest::touchEvent(&mWidget, mDev) |
| 379 | .release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 380 | .release(1, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr) |
| 381 | .release(2, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 382 | |
| 383 | if (mSpySwipeCanceled->count() == 0) { |
| 384 | QVERIFY(mSpySwipeCanceled->wait(1000)); |
| 385 | } |
| 386 | |
| 387 | QCOMPARE(mSpySwipeStarted->count(), 1); |
| 388 | QCOMPARE(mSpySwipeFinished->count(), 0); |
| 389 | QCOMPARE(mSpySwipeCanceled->count(), 1); |
| 390 | QVERIFY(mSpySwipeUpdated->count() >= 0); |
| 391 | QCOMPARE(mAngel, 0); |
| 392 | } |
| 393 | |
| 394 | void testFailingGesture_oneFinger() |
| 395 | { |
| 396 | clearSignalSpys(); |
| 397 | |
| 398 | const int length = mTwoFingerRec->minSswipeDistance(); |
| 399 | const QPoint swipeDistance = QPoint(length, 0); |
| 400 | |
| 401 | QTest::touchEvent(&mWidget, mDev).press(0, mTouchPointPos, (QWidget *)nullptr); |
| 402 | |
| 403 | QTest::touchEvent(&mWidget, mDev).move(0, mTouchPointPos + swipeDistance / 3, (QWidget *)nullptr); |
| 404 | |
| 405 | QTest::touchEvent(&mWidget, mDev).move(0, mTouchPointPos + swipeDistance / 2, (QWidget *)nullptr); |
| 406 | |
| 407 | QTest::touchEvent(&mWidget, mDev).move(0, mTouchPointPos + swipeDistance, (QWidget *)nullptr); |
| 408 | |
| 409 | QTest::touchEvent(&mWidget, mDev).release(0, mTouchPointPos + swipeDistance * 1.5, (QWidget *)nullptr); |
| 410 | |
| 411 | QCOMPARE(mSpySwipeStarted->count(), 0); |
| 412 | QCOMPARE(mSpySwipeFinished->count(), 0); |
| 413 | QCOMPARE(mSpySwipeCanceled->count(), 0); |
| 414 | QVERIFY(mSpySwipeUpdated->count() == 0); |
| 415 | } |
| 416 | |
| 417 | void testSomeRandomSwipes() |
| 418 | { |
| 419 | for (int i = 0; i < 50; ++i) { |
| 420 | const int x = rand() % 200 + 150; |
| 421 | const int y = rand() % 200 + 150; |
| 422 | mTouchPointPos = QPoint(x, y); |
| 423 | testSuccessfulGesture_right(); |
| 424 | testSuccessfulGesture_up(); |
| 425 | } |
| 426 | } |
| 427 | }; |
| 428 | |
| 429 | QTEST_MAIN(KTwoFingerSwipeTest) |
| 430 | |
| 431 | #include "ktwofingerswipetest.moc" |