diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-05-03 11:23:56 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-05-04 12:53:00 +0000 |
commit | aea55d29d2555c5649c13d3bc11bde4799c6bac5 (patch) | |
tree | 52434edff3041005f98b6899566fce119855efae /src/quicktemplates2/qquickvelocitycalculator_p_p.h | |
parent | a5d2731b1ec56580a79784759307d3b3c21ab87f (diff) |
Templates: use C++11 default member initialization
The code is more readable and less error-prone (this patch caught a few
uninitialized members) when the members are initialized in the same
place where they are declared. In many cases, empty default destructors
can be entirely removed, and we get faster implicitly declared inline
default constructors defined by the compiler.
Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickvelocitycalculator_p_p.h')
-rw-r--r-- | src/quicktemplates2/qquickvelocitycalculator_p_p.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickvelocitycalculator_p_p.h b/src/quicktemplates2/qquickvelocitycalculator_p_p.h index 144fe429..2b13ff07 100644 --- a/src/quicktemplates2/qquickvelocitycalculator_p_p.h +++ b/src/quicktemplates2/qquickvelocitycalculator_p_p.h @@ -56,8 +56,6 @@ QT_BEGIN_NAMESPACE class QQuickVelocityCalculator { public: - QQuickVelocityCalculator(); - void startMeasuring(const QPointF &point1, qint64 timestamp = 0); void stopMeasuring(const QPointF &m_point2, qint64 timestamp = 0); void reset(); @@ -66,8 +64,8 @@ public: private: QPointF m_point1; QPointF m_point2; - qint64 m_point1Timestamp; - qint64 m_point2Timestamp; + qint64 m_point1Timestamp = 0; + qint64 m_point2Timestamp = 0; // When a timestamp isn't available, we must use a timer. // When stopMeasuring() has been called, we store the elapsed time in point2timestamp. QElapsedTimer m_timer; |