summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-06-12 22:42:06 (GMT)
committerThiago Macieira <thiago.macieira@intel.com>2017-06-30 06:22:55 (GMT)
commit92ae0d2e5df16096893d03de3f5602d7d5d70e7d (patch)
treebb76e606ced0f6211082769f2c9148285a5283c3
parentc0fe554f498025067edd78e75e3efb46868f8fe6 (diff)
downloadqtsensors-92ae0d2e5df16096893d03de3f5602d7d5d70e7d.tar.gz
Use QRandomGenerator instead of q?rand
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
-rw-r--r--src/plugins/sensors/dummy/dummylightsensor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/sensors/dummy/dummylightsensor.cpp b/src/plugins/sensors/dummy/dummylightsensor.cpp
index 84c5b6f..47a1e75 100644
--- a/src/plugins/sensors/dummy/dummylightsensor.cpp
+++ b/src/plugins/sensors/dummy/dummylightsensor.cpp
@@ -39,7 +39,7 @@
#include "dummylightsensor.h"
#include <QDebug>
-#include <QtGlobal>
+#include <QRandomGenerator>
char const * const dummylightsensor::id("dummy.lightsensor");
@@ -53,7 +53,7 @@ dummylightsensor::dummylightsensor(QSensor *sensor)
void dummylightsensor::poll()
{
m_reading.setTimestamp(getTimestamp());
- if ((qrand() % 100) == 0)
+ if (QRandomGenerator::bounded(100) == 0)
m_reading.setLightLevel(QAmbientLightReading::Dark);
else
m_reading.setLightLevel(QAmbientLightReading::Light);