Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickvelocitycalculator_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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/qelapsedtimer.h>
20#include <QtCore/private/qglobal_p.h>
21
23
25{
26public:
27 void startMeasuring(const QPointF &point1, qint64 timestamp = 0);
28 void stopMeasuring(const QPointF &m_point2, qint64 timestamp = 0);
29 void reset();
30 QPointF velocity() const;
31
32private:
33 QPointF m_point1;
34 QPointF m_point2;
35 qint64 m_point1Timestamp = 0;
36 qint64 m_point2Timestamp = 0;
37 // When a timestamp isn't available, we must use a timer.
38 // When stopMeasuring() has been called, we store the elapsed time in point2timestamp.
39 QElapsedTimer m_timer;
40};
41
43
44#endif // QQUICKVELOCITYCALCULATOR_P_P_H
\inmodule QtCore
\inmodule QtCore\reentrant
Definition qpoint.h:217
void startMeasuring(const QPointF &point1, qint64 timestamp=0)
void stopMeasuring(const QPointF &m_point2, qint64 timestamp=0)
Combined button and popup list for selecting options.
long long qint64
Definition qtypes.h:60