1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKVELOCITYCALCULATOR_P_P_H
5#define QQUICKVELOCITYCALCULATOR_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qpoint.h>
19#include <QtCore/private/qglobal_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickVelocityCalculator
24{
25public:
26 void startMeasuring(const QPointF &point1, qint64 timestamp);
27 void stopMeasuring(const QPointF &m_point2, qint64 timestamp);
28 inline void reset() { *this = {}; }
29 QPointF velocity() const;
30
31private:
32 QPointF m_point1;
33 QPointF m_point2;
34 qint64 m_point1Timestamp = 0;
35 qint64 m_point2Timestamp = 0;
36};
37
38QT_END_NAMESPACE
39
40#endif // QQUICKVELOCITYCALCULATOR_P_P_H
41

source code of qtdeclarative/src/quicktemplates/qquickvelocitycalculator_p_p.h