Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.6
-
None
Description
void QSensor::setActive(bool active) { if (active == isActive()) return; if (active) QTimer::singleShot(0, this, SLOT(start())); // delay ensures all properties have been set if using QML else stop(); }
Screen { // an Item with visible: false as default id: proxScreen onVisibleChanged: { console.log("proxScreen.visible: "+ visible) } ProximitySensor { //F09 id: proximity active:proxScreen.visible onActiveChanged: { console.log("proximity.active: "+ active) } } }
Allows multiple queued starts/stops:
qml: proxScreen.visible: false qml: proximity.active: false qml: proximity.active: false
Looking at the QSensor::stop() code it is less clear how I can get multiple false activations, but even more puzzling, is why I get multiple false actives. The bound property (proxScreen.visible) only changed once. (But regardless the true or false I get double active changes)