diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-21 14:27:48 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-07-06 06:28:13 +0000 |
commit | 9e49778380c056b1ce7f30dbd774c545bff030c5 (patch) | |
tree | 04238d1dc639cdf3c7438c5deaca4d8e5f854ad7 /examples/widgets | |
parent | 829e421ddcd5e8ff065eaece965f499d7d1d8b40 (diff) |
Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code
Move those to the equivalent {to,set,from}SecsSinceEpoch(), except for
the cases that did QDateTime::currentDateTime{,Utc}().toTime_t. Those
are best implemented with QDateTime::currentSecsSinceEpoch().
Change-Id: Ib57b52598e2f452985e9fffd145a366c92cfda20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/animation/stickman/lifecycle.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/painting/composition/composition.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp index fcb351cf36..0ece4f3932 100644 --- a/examples/widgets/animation/stickman/lifecycle.cpp +++ b/examples/widgets/animation/stickman/lifecycle.cpp @@ -91,7 +91,7 @@ public: : QEventTransition(this, QEvent::Timer) { setTargetState(target); - qsrand((uint)QDateTime::currentDateTime().toTime_t()); + qsrand((uint)QDateTime::currentSecsSinceEpoch()); startTimer(1000); } diff --git a/examples/widgets/painting/composition/composition.cpp b/examples/widgets/painting/composition/composition.cpp index 1c2802f860..d5d674fd83 100644 --- a/examples/widgets/painting/composition/composition.cpp +++ b/examples/widgets/painting/composition/composition.cpp @@ -290,7 +290,7 @@ void CompositionRenderer::updateCirclePos() if (m_current_object != NoObject) return; QDateTime dt = QDateTime::currentDateTime(); - qreal t = (dt.toTime_t() * 1000 + dt.time().msec()) / 1000.0; + qreal t = dt.toMSecsSinceEpoch() / 1000.0; qreal x = width() / qreal(2) + (qCos(t*8/11) + qSin(-t)) * width() / qreal(4); qreal y = height() / qreal(2) + (qSin(t*6/7) + qCos(t * qreal(1.5))) * height() / qreal(4); |