@@ -49,7 +49,7 @@ class tst_DragHandle: public QObject
52− tst_DragHandle() : device(0) { }
52+ tst_DragHandle() : m_device(0) { }
53private Q_SLOTS:
53private Q_SLOTS:
54 void initTestCase(); // will be called before the first test function is executed
54 void initTestCase(); // will be called before the first test function is executed
55 void cleanupTestCase(); // will be called after the last test function was executed.
55 void cleanupTestCase(); // will be called after the last test function was executed.
@@ -67,22 +67,22 @@ private:
67 void tryCompare(std::function<qreal ()> actualFunc, qreal expectedValue);
67 void tryCompare(std::function<qreal ()> actualFunc, qreal expectedValue);
69 QQuickView *createView();
69 QQuickView *createView();
70− QQuickView *view;
70+ QQuickView *m_view;
71− QTouchDevice *device;
71+ QTouchDevice *m_device;
72− FakeTimer *fakeTimer;
72+ FakeTimer *m_fakeTimer;
73− FakeTimeSource *fakeTimeSource;
73+ FakeTimeSource *m_fakeTimeSource;
77void tst_DragHandle::initTestCase()
77void tst_DragHandle::initTestCase()
79− if (!device) {
79+ if (!m_device) {
80− device = new QTouchDevice;
80+ m_device = new QTouchDevice;
81− device->setType(QTouchDevice::TouchScreen);
81+ m_device->setType(QTouchDevice::TouchScreen);
82− QWindowSystemInterface::registerTouchDevice(device);
82+ QWindowSystemInterface::registerTouchDevice(m_device);
85− view = 0;
85+ m_view = 0;
88void tst_DragHandle::cleanupTestCase()
88void tst_DragHandle::cleanupTestCase()
@@ -91,27 +91,27 @@ void tst_DragHandle::cleanupTestCase()
92void tst_DragHandle::init()
92void tst_DragHandle::init()
94− view = createView();
94+ m_view = createView();
95− view->setSource(QUrl::fromLocalFile(TEST_DIR"/tst_DragHandle.qml"));
95+ m_view->setSource(QUrl::fromLocalFile(TEST_DIR"/tst_DragHandle.qml"));
96− view->show();
96+ m_view->show();
97− QVERIFY(QTest::qWaitForWindowExposed(view));
97+ QVERIFY(QTest::qWaitForWindowExposed(m_view));
98− QVERIFY(view->rootObject() != 0);
98+ QVERIFY(m_view->rootObject() != 0);
99 qApp->processEvents();
99 qApp->processEvents();
101− fakeTimer = new FakeTimer;
101+ m_fakeTimer = new FakeTimer;
102− fakeTimeSource = new FakeTimeSource;
102+ m_fakeTimeSource = new FakeTimeSource;
105void tst_DragHandle::cleanup()
105void tst_DragHandle::cleanup()
107− delete view;
107+ delete m_view;
108− view = 0;
108+ m_view = 0;
110− delete fakeTimer;
110+ delete m_fakeTimer;
111− fakeTimer = 0;
111+ m_fakeTimer = 0;
113− delete fakeTimeSource;
113+ delete m_fakeTimeSource;
114− fakeTimeSource = 0;
114+ m_fakeTimeSource = 0;
117QQuickView *tst_DragHandle::createView()
117QQuickView *tst_DragHandle::createView()
@@ -166,32 +166,32 @@ void tst_DragHandle::flickAndHold(DirectionalDragArea *dragHandle,
166 QPointF dragDirectionVector = calculateDirectionVector(dragHandle);
166 QPointF dragDirectionVector = calculateDirectionVector(dragHandle);
167 QPointF touchMovement = dragDirectionVector * (distance / (qreal)numSteps);
167 QPointF touchMovement = dragDirectionVector * (distance / (qreal)numSteps);
169− QTest::touchEvent(view, device).press(0, touchPoint.toPoint());
169+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
171 for (int i = 0; i < numSteps; ++i) {
171 for (int i = 0; i < numSteps; ++i) {
172 touchPoint += touchMovement;
172 touchPoint += touchMovement;
173− fakeTimeSource->m_msecsSinceReference += timeStep;
173+ m_fakeTimeSource->m_msecsSinceReference += timeStep;
174− QTest::touchEvent(view, device).move(0, touchPoint.toPoint());
174+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
177 // Wait for quite a bit before finally releasing to make a very low flick/release
177 // Wait for quite a bit before finally releasing to make a very low flick/release
178 // speed.
178 // speed.
179− fakeTimeSource->m_msecsSinceReference += 5000;
179+ m_fakeTimeSource->m_msecsSinceReference += 5000;
180− QTest::touchEvent(view, device).release(0, touchPoint.toPoint());
180+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
183DirectionalDragArea *tst_DragHandle::fetchAndSetupDragHandle(const char *objectName)
183DirectionalDragArea *tst_DragHandle::fetchAndSetupDragHandle(const char *objectName)
185 DirectionalDragArea *dragHandle =
185 DirectionalDragArea *dragHandle =
186− view->rootObject()->findChild<DirectionalDragArea*>(objectName);
186+ m_view->rootObject()->findChild<DirectionalDragArea*>(objectName);
187 Q_ASSERT(dragHandle != 0);
187 Q_ASSERT(dragHandle != 0);
188− dragHandle->setRecognitionTimer(fakeTimer);
188+ dragHandle->setRecognitionTimer(m_fakeTimer);
189− dragHandle->setTimeSource(fakeTimeSource);
189+ dragHandle->setTimeSource(m_fakeTimeSource);
191 AxisVelocityCalculator *edgeDragEvaluator =
191 AxisVelocityCalculator *edgeDragEvaluator =
192 dragHandle->findChild<AxisVelocityCalculator*>("edgeDragEvaluator");
192 dragHandle->findChild<AxisVelocityCalculator*>("edgeDragEvaluator");
193 Q_ASSERT(edgeDragEvaluator != 0);
193 Q_ASSERT(edgeDragEvaluator != 0);
194− edgeDragEvaluator->setTimeSource(fakeTimeSource);
194+ edgeDragEvaluator->setTimeSource(m_fakeTimeSource);
196 return dragHandle;
196 return dragHandle;