6#include <QtCore/qdebug.h>
33 m_point1Timestamp = timestamp;
40 if (timestamp == 0 && !m_timer.
isValid()) {
41 qWarning() <<
"QQuickVelocityCalculator: a call to stopMeasuring() must be preceded by a call to startMeasuring()";
46 m_point2Timestamp = timestamp != 0 ? timestamp : m_timer.
elapsed();
54 m_point1Timestamp = 0;
55 m_point2Timestamp = 0;
61 if ((m_point2Timestamp == 0 || m_point1Timestamp == m_point2Timestamp) && !m_timer.
isValid())
64 const qreal secondsElapsed = (m_point2Timestamp != 0 ? m_point2Timestamp - m_point1Timestamp : m_timer.
elapsed()) / 1000.0;
void invalidate() noexcept
Marks this QElapsedTimer object as invalid.
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
void start() noexcept
Starts this timer.
bool isValid() const noexcept
Returns false if the timer has never been started or invalidated by a call to invalidate().
\inmodule QtCore\reentrant
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.
GLsizei GLsizei GLfloat distance