@@ -1,59 +0,0 @@
2− * Copyright (C) 2015 Canonical, Ltd.
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
17−#include "FloatingFlickableHelper.h"
19−#include <QCoreApplication>
20−#include <QMouseEvent>
23−FloatingFlickableHelper::FloatingFlickableHelper(QObject *parent)
25− , m_mousePressed(false)
29−void FloatingFlickableHelper::onDragAreaTouchPosChanged(QQuickItem *flickable, const QPointF touchPosition)
31− if (m_mousePressed) {
32− QMouseEvent mouseEvent(QEvent::MouseMove,
33− QPointF(touchPosition.x(), touchPosition.y()),
34− Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
36− QCoreApplication::sendEvent(flickable, &mouseEvent);
41−void FloatingFlickableHelper::onDragAreaDraggingChanged(QQuickItem *flickable, bool dragging, const QPointF touchPosition)
43− if (dragging && !m_mousePressed) {
44− QMouseEvent mouseEvent(QEvent::MouseButtonPress,
45− QPointF(touchPosition.x(), touchPosition.y()),
46− Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
48− QCoreApplication::sendEvent(flickable, &mouseEvent);
49− m_mousePressed = true;
51− } else if (!dragging && m_mousePressed) {
52− QMouseEvent mouseEvent(QEvent::MouseButtonRelease,
53− QPointF(touchPosition.x(), touchPosition.y()),
54− Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
56− QCoreApplication::sendEvent(flickable, &mouseEvent);
57− m_mousePressed = false;