Examples: fix UB calls into QElapsedTimer

Calling restart() without start() is illegal, so don't do that; use
start() instead.

Pick-to: 6.8 6.5
Change-Id: I2ff5151f588cb926ccecc3d9997615e63f36ee24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 029407117f0584aea7722ff7702c9f4b83fa9013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Giuseppe D'Angelo 2025-03-25 12:04:35 +01:00 committed by Qt Cherry-pick Bot
parent 3b8a5859f8
commit f24dcf7bdb
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ void RenderThread::run()
constexpr int Limit = 4;
bool allBlack = true;
timer.restart();
timer.start();
for (int y = -halfHeight; y < halfHeight; ++y) {
if (restart)

View File

@ -237,7 +237,7 @@ void Connection::processData()
writer.endMap();
break;
case Pong:
pongTime.restart();
pongTime.start();
break;
default:
break;