diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-11-27 10:23:42 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-11-27 08:28:12 +0000 |
commit | 2127f2f68ce9cc7975afb19f883dec3d98ee5047 (patch) | |
tree | 661da3a50a06cf45baab60a7476ca4db8582f563 | |
parent | cee44751135f41a90e1b436483e54c90edd4d20d (diff) |
fix build against Qt 5.14
Change-Id: I882e79ebaf371eb6fb4bb6bc163b0b9099b370bc
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | plugin/cursornavigationattached.cpp | 7 | ||||
-rw-r--r-- | plugin/cursornavigationattached.h | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugin/cursornavigationattached.cpp b/plugin/cursornavigationattached.cpp index 44bcdb9..162f80c 100644 --- a/plugin/cursornavigationattached.cpp +++ b/plugin/cursornavigationattached.cpp @@ -41,6 +41,7 @@ #include "cursornavigation.h" #include <QQuickItem> #include <QQuickWindow> +#include <QVector2D> #include <QtMath> CursorNavigationAttached::CursorNavigationAttached(QQuickItem *parent) @@ -122,7 +123,7 @@ void CursorNavigationAttached::setMagnitude(qreal angle, qreal magnitude) m_cursorNavigation->m_currentItem->magnitudeChanged(angle, magnitude); } -void CursorNavigationAttached::setMagnitude(QVector2D vector) +void CursorNavigationAttached::setMagnitude(const QVector2D &vector) { if (m_cursorNavigation && m_cursorNavigation->m_currentItem) m_cursorNavigation->m_currentItem->magnitudeChanged( @@ -141,7 +142,7 @@ void CursorNavigationAttached::move(qreal angle, qreal tolerance) } } -void CursorNavigationAttached::move(QVector2D vector, qreal tolerance) +void CursorNavigationAttached::move(const QVector2D &vector, qreal tolerance) { if (m_cursorNavigation) { qWarning() << "move (vector)"; @@ -163,7 +164,7 @@ QQuickItem *CursorNavigationAttached::find(qreal angle, qreal tolerance) return nullptr; } -QQuickItem *CursorNavigationAttached::find(QVector2D vector, qreal tolerance) +QQuickItem *CursorNavigationAttached::find(const QVector2D &vector, qreal tolerance) { if (m_cursorNavigation) { qreal a = qAtan2(vector.y(), vector.x()); diff --git a/plugin/cursornavigationattached.h b/plugin/cursornavigationattached.h index ac37de3..e6f5621 100644 --- a/plugin/cursornavigationattached.h +++ b/plugin/cursornavigationattached.h @@ -49,6 +49,7 @@ class CursorNavigation; class QQuickItem; class QQuickWindow; +class QVector2D; class CursorNavigationAttached : public QObject { @@ -90,14 +91,14 @@ public slots: * events are received by the item that currently has the cursor */ void setMagnitude(qreal angle, qreal magnitude); - void setMagnitude(QVector2D vector); + void setMagnitude(const QVector2D &vector); void move(qreal angle, qreal tolerance = 0); - void move(QVector2D vector, qreal tolerance = 0); + void move(const QVector2D &vector, qreal tolerance = 0); //find the next item with this move, without moving QQuickItem *find(qreal angle, qreal tolerance = 0); - QQuickItem *find(QVector2D vector, qreal tolerance = 0); + QQuickItem *find(const QVector2D &vector, qreal tolerance = 0); void moveUp(); void moveDown(); |