17 #define ACTIVETOUCHESINFO_DEBUG 0
18 #define DIRECTIONALDRAGAREA_DEBUG 0
20 #include "DirectionalDragArea.h"
22 #include <QQuickWindow>
23 #include <QtCore/qmath.h>
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-pedantic"
28 #include <private/qquickwindow_p.h>
29 #pragma GCC diagnostic pop
32 #include "TouchOwnershipEvent.h"
33 #include "TouchRegistry.h"
34 #include "UnownedTouchEvent.h"
38 #if DIRECTIONALDRAGAREA_DEBUG
39 #define DDA_DEBUG(msg) qDebug("[DDA] " msg)
40 #include "DebugHelpers.h"
43 const char *statusToString(DirectionalDragArea::Status status)
45 if (status == DirectionalDragArea::WaitingForTouch) {
46 return "WaitingForTouch";
47 }
else if (status == DirectionalDragArea::Undecided) {
55 #else // DIRECTIONALDRAGAREA_DEBUG
56 #define DDA_DEBUG(msg) do{}while(0)
57 #endif // DIRECTIONALDRAGAREA_DEBUG
60 DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
62 , m_status(WaitingForTouch)
65 , m_direction(Direction::Rightwards)
68 , m_distanceThreshold(0)
69 , m_distanceThresholdSquared(0.)
71 , m_maxSilenceTime(200)
73 , m_compositionTime(60)
74 , m_numSamplesOnLastSpeedCheck(0)
75 , m_recognitionTimer(0)
76 , m_velocityCalculator(0)
77 , m_timeSource(new RealTimeSource)
78 , m_activeTouches(m_timeSource)
80 setRecognitionTimer(
new Timer(
this));
81 m_recognitionTimer->setInterval(60);
82 m_recognitionTimer->setSingleShot(
false);
84 m_velocityCalculator =
new AxisVelocityCalculator(
this);
86 connect(
this, &QQuickItem::enabledChanged,
this, &DirectionalDragArea::giveUpIfDisabledOrInvisible);
87 connect(
this, &QQuickItem::visibleChanged,
this, &DirectionalDragArea::giveUpIfDisabledOrInvisible);
90 Direction::Type DirectionalDragArea::direction()
const
95 void DirectionalDragArea::setDirection(Direction::Type direction)
97 if (direction != m_direction) {
98 m_direction = direction;
99 Q_EMIT directionChanged(m_direction);
103 void DirectionalDragArea::setMaxDeviation(qreal value)
105 if (m_dampedScenePos.maxDelta() != value) {
106 m_dampedScenePos.setMaxDelta(value);
107 Q_EMIT maxDeviationChanged(value);
111 qreal DirectionalDragArea::wideningAngle()
const
113 return m_wideningAngle;
116 void DirectionalDragArea::setWideningAngle(qreal angle)
118 if (angle == m_wideningAngle)
121 m_wideningAngle = angle;
125 qreal angleRadians = angle * M_PI / 180.0;
126 m_wideningFactor = qCos(angleRadians);
127 m_wideningFactor = m_wideningFactor * m_wideningFactor;
130 Q_EMIT wideningAngleChanged(angle);
133 void DirectionalDragArea::setDistanceThreshold(qreal value)
135 if (m_distanceThreshold != value) {
136 m_distanceThreshold = value;
137 m_distanceThresholdSquared = m_distanceThreshold * m_distanceThreshold;
138 Q_EMIT distanceThresholdChanged(value);
142 void DirectionalDragArea::setMinSpeed(qreal value)
144 if (m_minSpeed != value) {
146 Q_EMIT minSpeedChanged(value);
150 void DirectionalDragArea::setMaxSilenceTime(
int value)
152 if (m_maxSilenceTime != value) {
153 m_maxSilenceTime = value;
154 Q_EMIT maxSilenceTimeChanged(value);
158 void DirectionalDragArea::setCompositionTime(
int value)
160 if (m_compositionTime != value) {
161 m_compositionTime = value;
162 Q_EMIT compositionTimeChanged(value);
166 void DirectionalDragArea::setRecognitionTimer(UbuntuGestures::AbstractTimer *timer)
169 bool timerWasRunning =
false;
170 bool wasSingleShot =
false;
173 if (m_recognitionTimer) {
174 interval = m_recognitionTimer->interval();
175 timerWasRunning = m_recognitionTimer->isRunning();
176 if (m_recognitionTimer->parent() ==
this) {
177 delete m_recognitionTimer;
181 m_recognitionTimer = timer;
182 timer->setInterval(interval);
183 timer->setSingleShot(wasSingleShot);
184 connect(timer, &UbuntuGestures::AbstractTimer::timeout,
185 this, &DirectionalDragArea::checkSpeed);
186 if (timerWasRunning) {
187 m_recognitionTimer->start();
191 void DirectionalDragArea::setTimeSource(
const SharedTimeSource &timeSource)
193 m_timeSource = timeSource;
194 m_velocityCalculator->setTimeSource(timeSource);
195 m_activeTouches.m_timeSource = timeSource;
198 qreal DirectionalDragArea::distance()
const
200 if (Direction::isHorizontal(m_direction)) {
201 return m_previousPos.x() - m_startPos.x();
203 return m_previousPos.y() - m_startPos.y();
207 void DirectionalDragArea::updateSceneDistance()
209 QPointF totalMovement = m_previousScenePos - m_startScenePos;
210 m_sceneDistance = projectOntoDirectionVector(totalMovement);
213 qreal DirectionalDragArea::sceneDistance()
const
215 return m_sceneDistance;
218 qreal DirectionalDragArea::touchX()
const
220 return m_previousPos.x();
223 qreal DirectionalDragArea::touchY()
const
225 return m_previousPos.y();
228 qreal DirectionalDragArea::touchSceneX()
const
230 return m_previousScenePos.x();
233 qreal DirectionalDragArea::touchSceneY()
const
235 return m_previousScenePos.y();
238 bool DirectionalDragArea::event(QEvent *event)
240 if (event->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
241 touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(event));
243 }
else if (event->type() == UnownedTouchEvent::unownedTouchEventType()) {
244 unownedTouchEvent(static_cast<UnownedTouchEvent *>(event));
247 return QQuickItem::event(event);
251 void DirectionalDragArea::touchOwnershipEvent(TouchOwnershipEvent *event)
253 if (event->gained()) {
255 ids.append(event->touchId());
256 DDA_DEBUG(
"grabbing touch");
257 grabTouchPoints(ids);
264 QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window());
265 if (windowPrivate->touchMouseId == event->touchId() && window()->mouseGrabberItem()) {
266 DDA_DEBUG(
"removing mouse grabber");
267 window()->mouseGrabberItem()->ungrabMouse();
272 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
274 setStatus(WaitingForTouch);
278 void DirectionalDragArea::unownedTouchEvent(UnownedTouchEvent *unownedTouchEvent)
280 QTouchEvent *
event = unownedTouchEvent->touchEvent();
282 Q_ASSERT(!event->touchPointStates().testFlag(Qt::TouchPointPressed));
284 #if DIRECTIONALDRAGAREA_DEBUG
286 qDebug() <<
"[DDA] Unowned" << m_timeSource->msecsSinceReference()
287 << qPrintable(touchEventToString(event));
291 case WaitingForTouch:
295 Q_ASSERT(isEnabled() && isVisible());
296 unownedTouchEvent_undecided(unownedTouchEvent);
303 m_activeTouches.update(event);
306 void DirectionalDragArea::unownedTouchEvent_undecided(UnownedTouchEvent *unownedTouchEvent)
308 const QTouchEvent::TouchPoint *touchPoint = fetchTargetTouchPoint(unownedTouchEvent->touchEvent());
310 qCritical() <<
"DirectionalDragArea[status=Undecided]: touch " << m_touchId
311 <<
"missing from UnownedTouchEvent without first reaching state Qt::TouchPointReleased. "
312 "Considering it as released.";
314 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
315 setStatus(WaitingForTouch);
319 const QPointF &touchScenePos = touchPoint->scenePos();
321 if (touchPoint->state() == Qt::TouchPointReleased) {
323 DDA_DEBUG(
"Touch has ended before recognition concluded");
324 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
325 emitSignalIfTapped();
326 setStatus(WaitingForTouch);
330 m_previousDampedScenePos.setX(m_dampedScenePos.x());
331 m_previousDampedScenePos.setY(m_dampedScenePos.y());
332 m_dampedScenePos.update(touchScenePos);
333 updateVelocityCalculator(touchScenePos);
335 if (!pointInsideAllowedArea()) {
336 DDA_DEBUG(
"Rejecting gesture because touch point is outside allowed area.");
337 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
339 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
340 setStatus(WaitingForTouch);
344 if (!movingInRightDirection()) {
345 DDA_DEBUG(
"Rejecting gesture because touch point is moving in the wrong direction.");
346 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
348 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
349 setStatus(WaitingForTouch);
353 setPreviousPos(touchPoint->pos());
354 setPreviousScenePos(touchScenePos);
356 if (isWithinTouchCompositionWindow()) {
359 DDA_DEBUG(
"Sill within composition window. Let's wait more.");
363 if (movedFarEnough(touchScenePos)) {
364 TouchRegistry::instance()->requestTouchOwnership(m_touchId,
this);
365 setStatus(Recognized);
367 DDA_DEBUG(
"Didn't move far enough yet. Let's wait more.");
371 void DirectionalDragArea::touchEvent(QTouchEvent *event)
376 #if DIRECTIONALDRAGAREA_DEBUG
378 qDebug() <<
"[DDA]" << m_timeSource->msecsSinceReference()
379 << qPrintable(touchEventToString(event));
382 if (!isEnabled() || !isVisible()) {
383 QQuickItem::touchEvent(event);
388 case WaitingForTouch:
389 touchEvent_absent(event);
392 touchEvent_undecided(event);
395 touchEvent_recognized(event);
399 m_activeTouches.update(event);
402 void DirectionalDragArea::touchEvent_absent(QTouchEvent *event)
406 if (!event->touchPointStates().testFlag(Qt::TouchPointPressed)) {
414 if (isWithinTouchCompositionWindow()) {
417 #if DIRECTIONALDRAGAREA_DEBUG
418 qDebug(
"[DDA] A new touch point came in but we're still within time composition window. Ignoring it.");
423 const QList<QTouchEvent::TouchPoint> &touchPoints =
event->touchPoints();
425 const QTouchEvent::TouchPoint *newTouchPoint =
nullptr;
426 for (
int i = 0; i < touchPoints.count() && allGood; ++i) {
427 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
428 if (touchPoint.state() == Qt::TouchPointPressed) {
434 m_touchId = touchPoint.id();
435 newTouchPoint = &touchPoint;
441 Q_ASSERT(newTouchPoint);
443 m_startPos = newTouchPoint->pos();
444 m_startScenePos = newTouchPoint->scenePos();
445 m_touchId = newTouchPoint->id();
446 m_dampedScenePos.reset(m_startScenePos);
447 m_velocityCalculator->setTrackedPosition(0.);
448 m_velocityCalculator->reset();
449 m_numSamplesOnLastSpeedCheck = 0;
451 setPreviousPos(m_startPos);
452 setPreviousScenePos(m_startScenePos);
453 updateSceneDirectionVector();
455 if (recognitionIsDisabled()) {
457 TouchRegistry::instance()->requestTouchOwnership(m_touchId,
this);
458 setStatus(Recognized);
462 TouchRegistry::instance()->addCandidateOwnerForTouch(m_touchId,
this);
464 setStatus(Undecided);
470 watchPressedTouchPoints(touchPoints);
475 void DirectionalDragArea::touchEvent_undecided(QTouchEvent *event)
477 Q_ASSERT(event->type() == QEvent::TouchBegin);
478 Q_ASSERT(fetchTargetTouchPoint(event) ==
nullptr);
484 watchPressedTouchPoints(event->touchPoints());
486 if (event->touchPointStates().testFlag(Qt::TouchPointPressed) && isWithinTouchCompositionWindow()) {
488 DDA_DEBUG(
"Multi-finger drags are not accepted");
490 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
492 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
494 setStatus(WaitingForTouch);
498 void DirectionalDragArea::touchEvent_recognized(QTouchEvent *event)
500 const QTouchEvent::TouchPoint *touchPoint = fetchTargetTouchPoint(event);
503 qCritical() <<
"DirectionalDragArea[status=Recognized]: touch " << m_touchId
504 <<
"missing from QTouchEvent without first reaching state Qt::TouchPointReleased. "
505 "Considering it as released.";
506 setStatus(WaitingForTouch);
508 setPreviousPos(touchPoint->pos());
509 setPreviousScenePos(touchPoint->scenePos());
511 if (touchPoint->state() == Qt::TouchPointReleased) {
512 emitSignalIfTapped();
513 setStatus(WaitingForTouch);
518 void DirectionalDragArea::watchPressedTouchPoints(
const QList<QTouchEvent::TouchPoint> &touchPoints)
520 for (
int i = 0; i < touchPoints.count(); ++i) {
521 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
522 if (touchPoint.state() == Qt::TouchPointPressed) {
523 TouchRegistry::instance()->addTouchWatcher(touchPoint.id(),
this);
528 bool DirectionalDragArea::recognitionIsDisabled()
const
530 return distanceThreshold() <= 0 && compositionTime() <= 0;
533 void DirectionalDragArea::emitSignalIfTapped()
535 qint64 touchDuration = m_timeSource->msecsSinceReference() - m_activeTouches.touchStartTime(m_touchId);
536 if (touchDuration <= maxTapDuration()) {
541 const QTouchEvent::TouchPoint *DirectionalDragArea::fetchTargetTouchPoint(QTouchEvent *event)
543 const QList<QTouchEvent::TouchPoint> &touchPoints =
event->touchPoints();
544 const QTouchEvent::TouchPoint *touchPoint = 0;
545 for (
int i = 0; i < touchPoints.size(); ++i) {
546 if (touchPoints.at(i).id() == m_touchId) {
547 touchPoint = &touchPoints.at(i);
554 bool DirectionalDragArea::pointInsideAllowedArea()
const
559 QPointF totalMovement(m_dampedScenePos.x() - m_startScenePos.x(),
560 m_dampedScenePos.y() - m_startScenePos.y());
562 qreal squaredTotalMovSize = totalMovement.x() * totalMovement.x() +
563 totalMovement.y() * totalMovement.y();
565 if (squaredTotalMovSize == 0.) {
570 qreal projectedMovement = projectOntoDirectionVector(totalMovement);
573 qreal cosineAngleSquared = (projectedMovement * projectedMovement) / squaredTotalMovSize;
577 return cosineAngleSquared >= m_wideningFactor;
580 bool DirectionalDragArea::movingInRightDirection()
const
582 QPointF movementVector(m_dampedScenePos.x() - m_previousDampedScenePos.x(),
583 m_dampedScenePos.y() - m_previousDampedScenePos.y());
585 qreal scalarProjection = projectOntoDirectionVector(movementVector);
587 return scalarProjection >= 0.;
590 bool DirectionalDragArea::movedFarEnough(
const QPointF &point)
const
592 if (m_distanceThreshold <= 0.) {
596 QPointF totalMovement(point.x() - m_startScenePos.x(),
597 point.y() - m_startScenePos.y());
599 qreal squaredTotalMovSize = totalMovement.x() * totalMovement.x() +
600 totalMovement.y() * totalMovement.y();
602 return squaredTotalMovSize > m_distanceThresholdSquared;
606 void DirectionalDragArea::checkSpeed()
608 Q_ASSERT(m_status == Undecided);
610 if (m_velocityCalculator->numSamples() >= AxisVelocityCalculator::MIN_SAMPLES_NEEDED) {
611 qreal speed = qFabs(m_velocityCalculator->calculate());
612 qreal minSpeedMsecs = m_minSpeed / 1000.0;
614 if (speed < minSpeedMsecs) {
615 DDA_DEBUG(
"Rejecting gesture because it's below minimum speed.");
616 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
617 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
618 setStatus(WaitingForTouch);
622 if (m_velocityCalculator->numSamples() == m_numSamplesOnLastSpeedCheck) {
623 m_silenceTime += m_recognitionTimer->interval();
625 if (m_silenceTime > m_maxSilenceTime) {
626 DDA_DEBUG(
"Rejecting gesture because its silence time has been exceeded.");
627 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
628 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
629 setStatus(WaitingForTouch);
634 m_numSamplesOnLastSpeedCheck = m_velocityCalculator->numSamples();
637 void DirectionalDragArea::giveUpIfDisabledOrInvisible()
639 if (!isEnabled() || !isVisible()) {
640 if (m_status == Undecided) {
641 TouchRegistry::instance()->removeCandidateOwnerForTouch(m_touchId,
this);
643 TouchRegistry::instance()->addTouchWatcher(m_touchId,
this);
646 if (m_status != WaitingForTouch) {
647 DDA_DEBUG(
"Resetting status because got disabled or made invisible");
648 setStatus(WaitingForTouch);
653 void DirectionalDragArea::setStatus(DirectionalDragArea::Status newStatus)
655 if (newStatus == m_status)
658 DirectionalDragArea::Status oldStatus = m_status;
660 if (oldStatus == Undecided) {
661 m_recognitionTimer->stop();
664 m_status = newStatus;
665 Q_EMIT statusChanged(m_status);
667 #if DIRECTIONALDRAGAREA_DEBUG
668 qDebug() <<
"[DDA]" << statusToString(oldStatus) <<
"->" << statusToString(newStatus);
672 case WaitingForTouch:
673 Q_EMIT draggingChanged(
false);
676 m_recognitionTimer->start();
677 Q_EMIT draggingChanged(
true);
680 if (oldStatus == WaitingForTouch)
681 Q_EMIT draggingChanged(
true);
689 void DirectionalDragArea::setPreviousPos(
const QPointF &point)
691 bool xChanged = m_previousPos.x() != point.x();
692 bool yChanged = m_previousPos.y() != point.y();
694 m_previousPos = point;
697 Q_EMIT touchXChanged(point.x());
698 if (Direction::isHorizontal(m_direction))
699 Q_EMIT distanceChanged(distance());
703 Q_EMIT touchYChanged(point.y());
704 if (Direction::isVertical(m_direction))
705 Q_EMIT distanceChanged(distance());
709 void DirectionalDragArea::setPreviousScenePos(
const QPointF &point)
711 bool xChanged = m_previousScenePos.x() != point.x();
712 bool yChanged = m_previousScenePos.y() != point.y();
714 if (!xChanged && !yChanged)
717 qreal oldSceneDistance = sceneDistance();
718 m_previousScenePos = point;
719 updateSceneDistance();
721 if (oldSceneDistance != sceneDistance()) {
722 Q_EMIT sceneDistanceChanged(sceneDistance());
726 Q_EMIT touchSceneXChanged(point.x());
730 Q_EMIT touchSceneYChanged(point.y());
734 void DirectionalDragArea::updateVelocityCalculator(
const QPointF &scenePos)
736 QPointF totalSceneMovement = scenePos - m_startScenePos;
738 qreal scalarProjection = projectOntoDirectionVector(totalSceneMovement);
740 m_velocityCalculator->setTrackedPosition(scalarProjection);
743 bool DirectionalDragArea::isWithinTouchCompositionWindow()
746 compositionTime() > 0 &&
747 !m_activeTouches.isEmpty() &&
748 m_timeSource->msecsSinceReference() <=
749 m_activeTouches.mostRecentStartTime() + (qint64)compositionTime();
754 DirectionalDragArea::ActiveTouchesInfo::ActiveTouchesInfo(
const SharedTimeSource &timeSource)
755 : m_timeSource(timeSource)
759 void DirectionalDragArea::ActiveTouchesInfo::update(QTouchEvent *event)
761 if (!(event->touchPointStates() & (Qt::TouchPointPressed | Qt::TouchPointReleased))) {
763 #if ACTIVETOUCHESINFO_DEBUG
764 qDebug(
"[DDA::ActiveTouchesInfo] Nothing to Update");
769 const QList<QTouchEvent::TouchPoint> &touchPoints =
event->touchPoints();
770 for (
int i = 0; i < touchPoints.count(); ++i) {
771 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
772 if (touchPoint.state() == Qt::TouchPointPressed) {
773 addTouchPoint(touchPoint.id());
774 }
else if (touchPoint.state() == Qt::TouchPointReleased) {
775 removeTouchPoint(touchPoint.id());
780 #if ACTIVETOUCHESINFO_DEBUG
781 QString DirectionalDragArea::ActiveTouchesInfo::toString()
783 QString
string =
"(";
786 QTextStream stream(&
string);
787 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
788 stream <<
"(id=" << touchInfo->id <<
",startTime=" << touchInfo->startTime <<
")";
797 #endif // ACTIVETOUCHESINFO_DEBUG
799 void DirectionalDragArea::ActiveTouchesInfo::addTouchPoint(
int touchId)
801 ActiveTouchInfo &activeTouchInfo = m_touchInfoPool.getEmptySlot();
802 activeTouchInfo.id = touchId;
803 activeTouchInfo.startTime = m_timeSource->msecsSinceReference();
805 #if ACTIVETOUCHESINFO_DEBUG
806 qDebug() <<
"[DDA::ActiveTouchesInfo]" << qPrintable(toString());
810 qint64 DirectionalDragArea::ActiveTouchesInfo::touchStartTime(
int touchId)
814 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
815 if (touchId == touchInfo->id) {
816 result = touchInfo->startTime;
823 Q_ASSERT(result != -1);
827 void DirectionalDragArea::ActiveTouchesInfo::removeTouchPoint(
int touchId)
829 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &touchInfo) {
830 if (touchId == touchInfo->id) {
831 m_touchInfoPool.freeSlot(touchInfo);
838 #if ACTIVETOUCHESINFO_DEBUG
839 qDebug() <<
"[DDA::ActiveTouchesInfo]" << qPrintable(toString());
843 qint64 DirectionalDragArea::ActiveTouchesInfo::mostRecentStartTime()
845 Q_ASSERT(!m_touchInfoPool.isEmpty());
847 qint64 highestStartTime = -1;
849 m_touchInfoPool.forEach([&](Pool<ActiveTouchInfo>::Iterator &activeTouchInfo) {
850 if (activeTouchInfo->startTime > highestStartTime) {
851 highestStartTime = activeTouchInfo->startTime;
856 return highestStartTime;
859 void DirectionalDragArea::updateSceneDirectionVector()
861 QPointF localOrigin(0., 0.);
862 QPointF localDirection;
863 switch (m_direction) {
864 case Direction::Upwards:
865 localDirection.rx() = 0.;
866 localDirection.ry() = -1.;
868 case Direction::Downwards:
869 localDirection.rx() = 0.;
870 localDirection.ry() = 1;
872 case Direction::Leftwards:
873 localDirection.rx() = -1.;
874 localDirection.ry() = 0.;
877 localDirection.rx() = 1.;
878 localDirection.ry() = 0.;
881 QPointF sceneOrigin = mapToScene(localOrigin);
882 QPointF sceneDirection = mapToScene(localDirection);
883 m_sceneDirectionVector = sceneDirection - sceneOrigin;
886 qreal DirectionalDragArea::projectOntoDirectionVector(
const QPointF &sceneVector)
const
889 return sceneVector.x() * m_sceneDirectionVector.x() +
890 sceneVector.y() * m_sceneDirectionVector.y();
894 #include "DirectionalDragArea.moc"