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
22
QT_BEGIN_NAMESPACE
23
24
class
QQuickVelocityCalculator
25
{
26
public
:
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
32
private
:
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
42
QT_END_NAMESPACE
43
44
#endif
// QQUICKVELOCITYCALCULATOR_P_P_H
QElapsedTimer
\inmodule QtCore
Definition
qelapsedtimer.h:15
QPointF
\inmodule QtCore\reentrant
Definition
qpoint.h:217
QQuickVelocityCalculator
Definition
qquickvelocitycalculator_p_p.h:25
QQuickVelocityCalculator::reset
void reset()
Definition
qquickvelocitycalculator.cpp:50
QQuickVelocityCalculator::startMeasuring
void startMeasuring(const QPointF &point1, qint64 timestamp=0)
Definition
qquickvelocitycalculator.cpp:28
QQuickVelocityCalculator::velocity
QPointF velocity() const
Definition
qquickvelocitycalculator.cpp:59
QQuickVelocityCalculator::stopMeasuring
void stopMeasuring(const QPointF &m_point2, qint64 timestamp=0)
Definition
qquickvelocitycalculator.cpp:38
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
qint64
long long qint64
Definition
qtypes.h:60
qtdeclarative
src
quicktemplates
qquickvelocitycalculator_p_p.h
Generated by
1.10.0