Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why do you need a pure QML way?</p> <p>You can detect if an application has been sent to the background by installing an event filter. Check: <a href="http://www.developer.nokia.com/Community/Wiki/Detecting_when_a_Qt_application_has_been_switched_to_the_background_and_when_resumed" rel="nofollow">http://www.developer.nokia.com/Community/Wiki/Detecting_when_a_Qt_application_has_been_switched_to_the_background_and_when_resumed</a></p> <p>For a "pure" QML way, there is the <code>Symbian</code> QML element: <a href="http://doc.qt.nokia.com/qt-components-symbian/qml-symbian.html" rel="nofollow">http://doc.qt.nokia.com/qt-components-symbian/qml-symbian.html</a></p> <p>It has a <code>foreground</code> property that indicates whether the app is in the foreground or in the background. You can try connecting to <code>onForegroundChanged</code>.</p> <p>From the documentation, the <code>Symbian</code> element is not "creatable". It exists as a context property named <code>symbian</code>. So a sample usage would be:</p> <pre><code>import QtQuick 1.1 import com.nokia.symbian 1.1 PageStackWindow { id: window initialPage: MainPage {tools: toolBarLayout} showStatusBar: true showToolBar: true function appForegroundChanged() { console.log("Foreground: " + symbian.foreground) } function appCurrentTimeChanged() { console.log("Current time: " + symbian.currentTime) } Component.onCompleted: { symbian.currentTimeChanged.connect(appCurrentTimeChanged) symbian.foregroundChanged.connect(appForegroundChanged) } ToolBarLayout { id: toolBarLayout ToolButton { flat: true iconSource: "toolbar-back" onClicked: window.pageStack.depth &lt;= 1 ? Qt.quit() : window.pageStack.pop() } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload