From: Dmitry Shachnev <mitya57@debian.org>
Date: Mon, 2 Nov 2020 22:39:50 +0100
Subject: use QElapsedTimer instead of deprecated QTime::elapsed()

Forwarded: no
Last-Update: 2020-05-19
---
 examples/plots/mainwindow.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/plots/mainwindow.cpp b/examples/plots/mainwindow.cpp
index 77a40f1..a5d3405 100644
--- a/examples/plots/mainwindow.cpp
+++ b/examples/plots/mainwindow.cpp
@@ -1381,9 +1381,11 @@ void MainWindow::setupFinancialDemo(QCustomPlot *customPlot)
 
 void MainWindow::realtimeDataSlot()
 {
-  static QTime time(QTime::currentTime());
+  static QElapsedTimer timer;
+  if (!timer.isValid())
+    timer.start();
   // calculate two new data points:
-  double key = time.elapsed()/1000.0; // time elapsed since start of demo, in seconds
+  double key = timer.elapsed()/1000.0; // time elapsed since start of demo, in seconds
   static double lastPointKey = 0;
   if (key-lastPointKey > 0.002) // at most add point every 2 ms
   {
