diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-09-06 08:04:13 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-09-07 04:16:55 (GMT) |
commit | ead14cd61da071ac10e7a83b9c1d05098cf2a679 (patch) | |
tree | 3da3f83459fde89afab69de35d22e0ee8baea801 /tools/qml/qmlruntime.cpp | |
parent | 3113a91f50f12c8ee53f2e84f6b46fde6c2c1693 (diff) | |
download | Qt-ead14cd61da071ac10e7a83b9c1d05098cf2a679.zip Qt-ead14cd61da071ac10e7a83b9c1d05098cf2a679.tar.gz Qt-ead14cd61da071ac10e7a83b9c1d05098cf2a679.tar.bz2 |
Pause orientation sensors in Qml Viewer when the application window is not active
Task-number: QTBUG-13347
Reviewed-by: Martin Jones
Diffstat (limited to 'tools/qml/qmlruntime.cpp')
-rw-r--r-- | tools/qml/qmlruntime.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 321b7fd..b38e80d 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1208,8 +1208,10 @@ bool QDeclarativeViewer::event(QEvent *event) { if (event->type() == QEvent::WindowActivate) { Runtime::instance()->setActiveWindow(true); + DeviceOrientation::instance()->resumeListening(); } else if (event->type() == QEvent::WindowDeactivate) { Runtime::instance()->setActiveWindow(false); + DeviceOrientation::instance()->pauseListening(); } return QWidget::event(event); } |