aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-07-26 16:33:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-27 10:42:54 +0000
commit0e1f83dcade8cb6428513eea4452dcd500f9e486 (patch)
tree227c4848145b23fde12ad33d3bea3a60c04cb36e
parent447e2e024609a22fe052cf458c27efdef2e3d3eb (diff)
Fix PointerHandler constructors and destructors
- Constructors should take QQuickItem* not QObject* to be symmetric with the parentItem() accessor (and other code) which assumes its type - Use header initialization everywhere possible - Reorder variables to minimize padding (somewhat) - Remove empty destructor bodies (the compiler can write them) - Remove override and virtual from destructors in accordance with https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override Change-Id: I682a53a803d65e29136bfaec3a5b534e975ecf30 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r--src/quick/handlers/qquickdraghandler.cpp6
-rw-r--r--src/quick/handlers/qquickdraghandler_p.h3
-rw-r--r--src/quick/handlers/qquickhandlerpoint.cpp3
-rw-r--r--src/quick/handlers/qquickhandlerpoint_p.h10
-rw-r--r--src/quick/handlers/qquickhoverhandler.cpp3
-rw-r--r--src/quick/handlers/qquickhoverhandler_p.h4
-rw-r--r--src/quick/handlers/qquickmultipointhandler.cpp6
-rw-r--r--src/quick/handlers/qquickmultipointhandler_p.h3
-rw-r--r--src/quick/handlers/qquickpinchhandler.cpp21
-rw-r--r--src/quick/handlers/qquickpinchhandler_p.h35
-rw-r--r--src/quick/handlers/qquickpointerdevicehandler.cpp8
-rw-r--r--src/quick/handlers/qquickpointerdevicehandler_p.h5
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp8
-rw-r--r--src/quick/handlers/qquickpointerhandler_p.h6
-rw-r--r--src/quick/handlers/qquickpointerhandler_p_p.h1
-rw-r--r--src/quick/handlers/qquickpointhandler.cpp6
-rw-r--r--src/quick/handlers/qquickpointhandler_p.h3
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp3
-rw-r--r--src/quick/handlers/qquicksinglepointhandler_p.h5
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp11
-rw-r--r--src/quick/handlers/qquicktaphandler_p.h17
21 files changed, 53 insertions, 114 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp
index 7c175b472b..d9f0e477d1 100644
--- a/src/quick/handlers/qquickdraghandler.cpp
+++ b/src/quick/handlers/qquickdraghandler.cpp
@@ -88,15 +88,11 @@ Q_LOGGING_CATEGORY(lcDragHandler, "qt.quick.handler.drag")
\sa Drag, MouseArea
*/
-QQuickDragHandler::QQuickDragHandler(QObject *parent)
+QQuickDragHandler::QQuickDragHandler(QQuickItem *parent)
: QQuickMultiPointHandler(parent, 1, 1)
{
}
-QQuickDragHandler::~QQuickDragHandler()
-{
-}
-
bool QQuickDragHandler::targetContainsCentroid()
{
Q_ASSERT(parentItem() && target());
diff --git a/src/quick/handlers/qquickdraghandler_p.h b/src/quick/handlers/qquickdraghandler_p.h
index ea49d59902..25101a98c4 100644
--- a/src/quick/handlers/qquickdraghandler_p.h
+++ b/src/quick/handlers/qquickdraghandler_p.h
@@ -64,8 +64,7 @@ class Q_AUTOTEST_EXPORT QQuickDragHandler : public QQuickMultiPointHandler
Q_PROPERTY(QVector2D translation READ translation NOTIFY translationChanged)
public:
- explicit QQuickDragHandler(QObject *parent = nullptr);
- ~QQuickDragHandler();
+ explicit QQuickDragHandler(QQuickItem *parent = nullptr);
void handlePointerEventImpl(QQuickPointerEvent *event) override;
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index be9bad7bea..f615829d97 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -72,9 +72,6 @@ Q_DECLARE_LOGGING_CATEGORY(DBG_TOUCH_TARGET)
*/
QQuickHandlerPoint::QQuickHandlerPoint()
- : m_id(0)
- , m_rotation(0)
- , m_pressure(0)
{}
void QQuickHandlerPoint::localize(QQuickItem *item)
diff --git a/src/quick/handlers/qquickhandlerpoint_p.h b/src/quick/handlers/qquickhandlerpoint_p.h
index 200d5bc825..44fd830af2 100644
--- a/src/quick/handlers/qquickhandlerpoint_p.h
+++ b/src/quick/handlers/qquickhandlerpoint_p.h
@@ -97,18 +97,18 @@ public:
void reset(const QVector<QQuickHandlerPoint> &points);
private:
- int m_id;
+ int m_id = 0;
QPointingDeviceUniqueId m_uniqueId;
- Qt::MouseButtons m_pressedButtons;
- Qt::KeyboardModifiers m_pressedModifiers;
+ Qt::MouseButtons m_pressedButtons = Qt::NoButton;
+ Qt::KeyboardModifiers m_pressedModifiers = Qt::NoModifier;
QPointF m_position;
QPointF m_scenePosition;
QPointF m_pressPosition;
QPointF m_scenePressPosition;
QPointF m_sceneGrabPosition;
QVector2D m_velocity;
- qreal m_rotation;
- qreal m_pressure;
+ qreal m_rotation = 0;
+ qreal m_pressure = 0;
QSizeF m_ellipseDiameters;
friend class QQuickMultiPointHandler;
friend class QQuickSinglePointHandler;
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp
index 817c1348e6..ef6fb4eb7e 100644
--- a/src/quick/handlers/qquickhoverhandler.cpp
+++ b/src/quick/handlers/qquickhoverhandler.cpp
@@ -56,9 +56,8 @@ Q_LOGGING_CATEGORY(lcHoverHandler, "qt.quick.handler.hover")
\sa MouseArea
*/
-QQuickHoverHandler::QQuickHoverHandler(QObject *parent)
+QQuickHoverHandler::QQuickHoverHandler(QQuickItem *parent)
: QQuickSinglePointHandler(parent)
- , m_hovered(false)
{
// Rule out the touchscreen for now (can be overridden in QML in case a hover-detecting touchscreen exists)
setAcceptedDevices(static_cast<QQuickPointerDevice::DeviceType>(
diff --git a/src/quick/handlers/qquickhoverhandler_p.h b/src/quick/handlers/qquickhoverhandler_p.h
index 876d01761b..1ee2aeb7e6 100644
--- a/src/quick/handlers/qquickhoverhandler_p.h
+++ b/src/quick/handlers/qquickhoverhandler_p.h
@@ -64,7 +64,7 @@ class Q_AUTOTEST_EXPORT QQuickHoverHandler : public QQuickSinglePointHandler
Q_PROPERTY(bool hovered READ isHovered NOTIFY hoveredChanged)
public:
- explicit QQuickHoverHandler(QObject *parent = 0);
+ explicit QQuickHoverHandler(QQuickItem *parent = nullptr);
~QQuickHoverHandler();
bool isHovered() const { return m_hovered; }
@@ -81,7 +81,7 @@ private:
void setHovered(bool hovered);
private:
- bool m_hovered;
+ bool m_hovered = false;
};
QT_END_NAMESPACE
diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp
index 98321e134a..687bccdc4f 100644
--- a/src/quick/handlers/qquickmultipointhandler.cpp
+++ b/src/quick/handlers/qquickmultipointhandler.cpp
@@ -58,17 +58,13 @@ QT_BEGIN_NAMESPACE
for any type of handler which requires and acts upon a specific number
of multiple touchpoints.
*/
-QQuickMultiPointHandler::QQuickMultiPointHandler(QObject *parent, int minimumPointCount, int maximumPointCount)
+QQuickMultiPointHandler::QQuickMultiPointHandler(QQuickItem *parent, int minimumPointCount, int maximumPointCount)
: QQuickPointerDeviceHandler(parent)
, m_minimumPointCount(minimumPointCount)
, m_maximumPointCount(maximumPointCount)
{
}
-QQuickMultiPointHandler::~QQuickMultiPointHandler()
-{
-}
-
bool QQuickMultiPointHandler::wantsPointerEvent(QQuickPointerEvent *event)
{
if (!QQuickPointerDeviceHandler::wantsPointerEvent(event))
diff --git a/src/quick/handlers/qquickmultipointhandler_p.h b/src/quick/handlers/qquickmultipointhandler_p.h
index fbd9f378a3..199ea7cd10 100644
--- a/src/quick/handlers/qquickmultipointhandler_p.h
+++ b/src/quick/handlers/qquickmultipointhandler_p.h
@@ -66,8 +66,7 @@ class Q_AUTOTEST_EXPORT QQuickMultiPointHandler : public QQuickPointerDeviceHand
Q_PROPERTY(QQuickHandlerPoint centroid READ centroid NOTIFY centroidChanged)
public:
- explicit QQuickMultiPointHandler(QObject *parent = nullptr, int minimumPointCount = 2, int maximumPointCount = -1);
- ~QQuickMultiPointHandler();
+ explicit QQuickMultiPointHandler(QQuickItem *parent = nullptr, int minimumPointCount = 2, int maximumPointCount = -1);
int minimumPointCount() const { return m_minimumPointCount; }
void setMinimumPointCount(int c);
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp
index d6e1a183bb..75a2847aa0 100644
--- a/src/quick/handlers/qquickpinchhandler.cpp
+++ b/src/quick/handlers/qquickpinchhandler.cpp
@@ -85,27 +85,8 @@ Q_LOGGING_CATEGORY(lcPinchHandler, "qt.quick.handler.pinch")
\sa PinchArea
*/
-QQuickPinchHandler::QQuickPinchHandler(QObject *parent)
+QQuickPinchHandler::QQuickPinchHandler(QQuickItem *parent)
: QQuickMultiPointHandler(parent, 2)
- , m_activeScale(1)
- , m_accumulatedScale(1)
- , m_activeRotation(0)
- , m_activeTranslation(0,0)
- , m_minimumScale(-qInf())
- , m_maximumScale(qInf())
- , m_minimumRotation(-qInf())
- , m_maximumRotation(qInf())
- , m_minimumX(-qInf())
- , m_maximumX(qInf())
- , m_minimumY(-qInf())
- , m_maximumY(qInf())
- , m_pinchOrigin(PinchCenter)
- , m_startScale(1)
- , m_startRotation(0)
-{
-}
-
-QQuickPinchHandler::~QQuickPinchHandler()
{
}
diff --git a/src/quick/handlers/qquickpinchhandler_p.h b/src/quick/handlers/qquickpinchhandler_p.h
index 0d0630d2a9..305802b6cf 100644
--- a/src/quick/handlers/qquickpinchhandler_p.h
+++ b/src/quick/handlers/qquickpinchhandler_p.h
@@ -81,8 +81,7 @@ public:
};
Q_ENUM(PinchOrigin)
- explicit QQuickPinchHandler(QObject *parent = nullptr);
- ~QQuickPinchHandler();
+ explicit QQuickPinchHandler(QQuickItem *parent = nullptr);
qreal minimumScale() const { return m_minimumScale; }
void setMinimumScale(qreal minimumScale);
@@ -131,28 +130,28 @@ protected:
private:
// properties
- qreal m_activeScale;
- qreal m_accumulatedScale;
- qreal m_activeRotation;
- QVector2D m_activeTranslation;
+ qreal m_activeScale = 1;
+ qreal m_accumulatedScale = 1;
+ qreal m_activeRotation = 0;
+ QVector2D m_activeTranslation = QVector2D(0, 0);
- qreal m_minimumScale;
- qreal m_maximumScale;
+ qreal m_minimumScale = -qInf();
+ qreal m_maximumScale = qInf();
- qreal m_minimumRotation;
- qreal m_maximumRotation;
+ qreal m_minimumRotation = -qInf();
+ qreal m_maximumRotation = qInf();
- qreal m_minimumX;
- qreal m_maximumX;
- qreal m_minimumY;
- qreal m_maximumY;
+ qreal m_minimumX = -qInf();
+ qreal m_maximumX = qInf();
+ qreal m_minimumY = -qInf();
+ qreal m_maximumY = qInf();
- PinchOrigin m_pinchOrigin;
+ PinchOrigin m_pinchOrigin = PinchOrigin::PinchCenter;
// internal
- qreal m_startScale;
- qreal m_startRotation;
- qreal m_startDistance;
+ qreal m_startScale = 1;
+ qreal m_startRotation = 0;
+ qreal m_startDistance = 0;
QPointF m_startPos;
QVector<PointData> m_startAngles;
diff --git a/src/quick/handlers/qquickpointerdevicehandler.cpp b/src/quick/handlers/qquickpointerdevicehandler.cpp
index dfea3ec02d..24b3dc4733 100644
--- a/src/quick/handlers/qquickpointerdevicehandler.cpp
+++ b/src/quick/handlers/qquickpointerdevicehandler.cpp
@@ -57,20 +57,16 @@ QT_BEGIN_NAMESPACE
An intermediate class (not registered as a QML type) for handlers which
allow filtering based on device type, pointer type, or keyboard modifiers.
*/
-QQuickPointerDeviceHandler::QQuickPointerDeviceHandler(QObject *parent)
+QQuickPointerDeviceHandler::QQuickPointerDeviceHandler(QQuickItem *parent)
: QQuickPointerHandler(*(new QQuickPointerDeviceHandlerPrivate), parent)
{
}
-QQuickPointerDeviceHandler::QQuickPointerDeviceHandler(QQuickPointerDeviceHandlerPrivate &dd, QObject *parent)
+QQuickPointerDeviceHandler::QQuickPointerDeviceHandler(QQuickPointerDeviceHandlerPrivate &dd, QQuickItem *parent)
: QQuickPointerHandler(dd, parent)
{
}
-QQuickPointerDeviceHandler::~QQuickPointerDeviceHandler()
-{
-}
-
QQuickPointerDevice::DeviceTypes QQuickPointerDeviceHandler::acceptedDevices() const
{
Q_D(const QQuickPointerDeviceHandler);
diff --git a/src/quick/handlers/qquickpointerdevicehandler_p.h b/src/quick/handlers/qquickpointerdevicehandler_p.h
index 4194769fd7..82b24369d3 100644
--- a/src/quick/handlers/qquickpointerdevicehandler_p.h
+++ b/src/quick/handlers/qquickpointerdevicehandler_p.h
@@ -65,8 +65,7 @@ class Q_AUTOTEST_EXPORT QQuickPointerDeviceHandler : public QQuickPointerHandler
Q_PROPERTY(Qt::KeyboardModifiers acceptedModifiers READ acceptedModifiers WRITE setAcceptedModifiers NOTIFY acceptedModifiersChanged)
public:
- explicit QQuickPointerDeviceHandler(QObject *parent = nullptr);
- ~QQuickPointerDeviceHandler();
+ explicit QQuickPointerDeviceHandler(QQuickItem *parent = nullptr);
QQuickPointerDevice::DeviceTypes acceptedDevices() const;
QQuickPointerDevice::PointerTypes acceptedPointerTypes() const;
@@ -86,7 +85,7 @@ Q_SIGNALS:
void acceptedModifiersChanged();
protected:
- QQuickPointerDeviceHandler(QQuickPointerDeviceHandlerPrivate &dd, QObject *parent = nullptr);
+ QQuickPointerDeviceHandler(QQuickPointerDeviceHandlerPrivate &dd, QQuickItem *parent = nullptr);
bool wantsPointerEvent(QQuickPointerEvent *event) override;
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 91349a6ad7..0be3c05e96 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -60,12 +60,12 @@ Q_LOGGING_CATEGORY(lcPointerHandlerActive, "qt.quick.handler.active")
events from any kind of pointing device (touch, mouse or graphics tablet).
*/
-QQuickPointerHandler::QQuickPointerHandler(QObject *parent)
+QQuickPointerHandler::QQuickPointerHandler(QQuickItem *parent)
: QObject(*(new QQuickPointerHandlerPrivate), parent)
{
}
-QQuickPointerHandler::QQuickPointerHandler(QQuickPointerHandlerPrivate &dd, QObject *parent)
+QQuickPointerHandler::QQuickPointerHandler(QQuickPointerHandlerPrivate &dd, QQuickItem *parent)
: QObject(dd, parent)
{
}
@@ -528,8 +528,4 @@ QQuickPointerHandlerPrivate::QQuickPointerHandlerPrivate()
{
}
-QQuickPointerHandlerPrivate::~QQuickPointerHandlerPrivate()
-{
-}
-
QT_END_NAMESPACE
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h
index 9644bb959f..69a38706b3 100644
--- a/src/quick/handlers/qquickpointerhandler_p.h
+++ b/src/quick/handlers/qquickpointerhandler_p.h
@@ -73,8 +73,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerHandler : public QObject, public QQmlP
Q_PROPERTY(qreal margin READ margin WRITE setMargin NOTIFY marginChanged)
public:
- explicit QQuickPointerHandler(QObject *parent = nullptr);
- virtual ~QQuickPointerHandler();
+ explicit QQuickPointerHandler(QQuickItem *parent = nullptr);
+ ~QQuickPointerHandler();
enum GrabPermission {
TakeOverForbidden = 0x0,
@@ -120,7 +120,7 @@ Q_SIGNALS:
void canceled(QQuickEventPoint *point);
protected:
- QQuickPointerHandler(QQuickPointerHandlerPrivate &dd, QObject *parent);
+ QQuickPointerHandler(QQuickPointerHandlerPrivate &dd, QQuickItem *parent);
void classBegin() override;
void componentComplete() override;
diff --git a/src/quick/handlers/qquickpointerhandler_p_p.h b/src/quick/handlers/qquickpointerhandler_p_p.h
index c0b2b84a66..2ea4905643 100644
--- a/src/quick/handlers/qquickpointerhandler_p_p.h
+++ b/src/quick/handlers/qquickpointerhandler_p_p.h
@@ -67,7 +67,6 @@ public:
static const QQuickPointerHandlerPrivate* get(const QQuickPointerHandler *q) { return q->d_func(); }
QQuickPointerHandlerPrivate();
- virtual ~QQuickPointerHandlerPrivate() override;
QQuickPointerEvent *currentEvent = nullptr;
QQuickItem *target = nullptr;
diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp
index 65a7fd7b79..da19584b7a 100644
--- a/src/quick/handlers/qquickpointhandler.cpp
+++ b/src/quick/handlers/qquickpointhandler.cpp
@@ -114,16 +114,12 @@ QT_BEGIN_NAMESPACE
\sa MultiPointTouchArea
*/
-QQuickPointHandler::QQuickPointHandler(QObject *parent)
+QQuickPointHandler::QQuickPointHandler(QQuickItem *parent)
: QQuickSinglePointHandler(parent)
{
setIgnoreAdditionalPoints();
}
-QQuickPointHandler::~QQuickPointHandler()
-{
-}
-
bool QQuickPointHandler::wantsEventPoint(QQuickEventPoint *pt)
{
// On press, we want it unless a sibling of the same type also does.
diff --git a/src/quick/handlers/qquickpointhandler_p.h b/src/quick/handlers/qquickpointhandler_p.h
index 5babab0c4d..380ce1f90f 100644
--- a/src/quick/handlers/qquickpointhandler_p.h
+++ b/src/quick/handlers/qquickpointhandler_p.h
@@ -61,8 +61,7 @@ class Q_AUTOTEST_EXPORT QQuickPointHandler : public QQuickSinglePointHandler
Q_PROPERTY(QVector2D translation READ translation NOTIFY translationChanged)
public:
- explicit QQuickPointHandler(QObject *parent = 0);
- ~QQuickPointHandler();
+ explicit QQuickPointHandler(QQuickItem *parent = nullptr);
QVector2D translation() const;
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index 0f8fc58bc1..fa08ced8e2 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -58,9 +58,8 @@ Q_DECLARE_LOGGING_CATEGORY(DBG_TOUCH_TARGET)
Override handleEventPoint() to implement a single-point handler.
*/
-QQuickSinglePointHandler::QQuickSinglePointHandler(QObject *parent)
+QQuickSinglePointHandler::QQuickSinglePointHandler(QQuickItem *parent)
: QQuickPointerDeviceHandler(parent)
- , m_ignoreAdditionalPoints(false)
{
}
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h
index 7c225aab46..6caf4294b8 100644
--- a/src/quick/handlers/qquicksinglepointhandler_p.h
+++ b/src/quick/handlers/qquicksinglepointhandler_p.h
@@ -61,8 +61,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickSinglePointHandler : public QQuickPointerDevi
Q_OBJECT
Q_PROPERTY(QQuickHandlerPoint point READ point NOTIFY pointChanged)
public:
- explicit QQuickSinglePointHandler(QObject *parent = nullptr);
- virtual ~QQuickSinglePointHandler() { }
+ explicit QQuickSinglePointHandler(QQuickItem *parent = nullptr);
QQuickHandlerPoint point() const { return m_pointInfo; }
@@ -89,7 +88,7 @@ private:
private:
QQuickHandlerPoint m_pointInfo;
- bool m_ignoreAdditionalPoints : 1;
+ bool m_ignoreAdditionalPoints = false;
};
QT_END_NAMESPACE
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index 1d3375314f..992bc5e438 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -84,13 +84,8 @@ int QQuickTapHandler::m_touchMultiTapDistanceSquared(-1);
\sa MouseArea
*/
-QQuickTapHandler::QQuickTapHandler(QObject *parent)
+QQuickTapHandler::QQuickTapHandler(QQuickItem *parent)
: QQuickSinglePointHandler(parent)
- , m_pressed(false)
- , m_gesturePolicy(DragThreshold)
- , m_tapCount(0)
- , m_longPressThreshold(-1)
- , m_lastTapTimestamp(0.0)
{
if (m_mouseMultiClickDistanceSquared < 0) {
m_multiTapInterval = qApp->styleHints()->mouseDoubleClickInterval() / 1000.0;
@@ -103,10 +98,6 @@ QQuickTapHandler::QQuickTapHandler(QObject *parent)
}
}
-QQuickTapHandler::~QQuickTapHandler()
-{
-}
-
static bool dragOverThreshold(const QQuickEventPoint *point)
{
QPointF delta = point->scenePosition() - point->scenePressPosition();
diff --git a/src/quick/handlers/qquicktaphandler_p.h b/src/quick/handlers/qquicktaphandler_p.h
index b7c1895926..a4c5bf657e 100644
--- a/src/quick/handlers/qquicktaphandler_p.h
+++ b/src/quick/handlers/qquicktaphandler_p.h
@@ -75,8 +75,7 @@ public:
};
Q_ENUM(GesturePolicy)
- explicit QQuickTapHandler(QObject *parent = nullptr);
- ~QQuickTapHandler();
+ explicit QQuickTapHandler(QQuickItem *parent = nullptr);
bool isPressed() const { return m_pressed; }
@@ -113,14 +112,14 @@ private:
void updateTimeHeld();
private:
- bool m_pressed;
- GesturePolicy m_gesturePolicy;
- int m_tapCount;
- int m_longPressThreshold;
- QBasicTimer m_longPressTimer;
- QElapsedTimer m_holdTimer;
QPointF m_lastTapPos;
- qreal m_lastTapTimestamp;
+ qreal m_lastTapTimestamp = 0;
+ QElapsedTimer m_holdTimer;
+ QBasicTimer m_longPressTimer;
+ int m_tapCount = 0;
+ int m_longPressThreshold = -1;
+ GesturePolicy m_gesturePolicy = GesturePolicy::DragThreshold;
+ bool m_pressed = false;
static qreal m_multiTapInterval;
static int m_mouseMultiClickDistanceSquared;