diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2012-04-16 14:54:23 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-20 05:12:51 +0200 |
commit | 7628b8de96bc1de3f97d1ea2e4519139a4937f8a (patch) | |
tree | 438ad46d2b0fc9223f6975cf91933ca604feaa6f /src/imports/sensors | |
parent | 01fea6e0d5a0ef709c1660e2420a842b90e6f85f (diff) |
Changes so that sensor.start() does not block (QML)
The C++ library tries to delay things as much as possible. It turns
out that doing this for QML is not optimal because it means calling
sensor.start() can block for a long time (up to hundreds of
milliseconds in worst case scenarious). If the sensor is started
after the UI is visible, this will cause a stutter.
The workaround is not particularly elegant. We force the sensors
library to do its setup while the QML plugin is being loaded.
Change-Id: Iae945ccb79eb568c5decbfdf8a5d623cd96e9d6b
Reviewed-by: Zsolt Simon <zsolt.simon@nokia.com>
Diffstat (limited to 'src/imports/sensors')
-rw-r--r-- | src/imports/sensors/sensors.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp index b81bdd3d..f65af6a2 100644 --- a/src/imports/sensors/sensors.cpp +++ b/src/imports/sensors/sensors.cpp @@ -106,6 +106,9 @@ public: int major; int minor; + // Force all of the sensors initialization to happen now, while we don't have a UI thread to interrupt + (void)QSensor::sensorTypes(); + // Register the 1.1 interfaces major = 1; minor = 1; |