title: How to do an action in Qml every time a user touches the screen?
body: <p>I am writing an application for an embedded linux touchscreen device using Qt and Qml.<br>
  I need to implement a lock screen that appears after 30 seconds of inactivity.<br>
  To do this I've implemented a timer in C++, that changes the state of the program after timeout. </p>
  
  <p>Is it possible to refresh this timer on a global scale every time the user touches the screen, so that I do not have to call the timers' <code>start()</code> slot in every touchable element in my program?</p>
  
  <p>I would also like to refresh this timer even when the user touches a part of the screen where there are no buttons/interactive elements.</p>
  
  <p>Something like this main.qml:</p>
  
  <pre><code>Rectangle {
      id: mainRect
      width: 800
      height: 480
  
  //something like this (oversimplified) pseudo code:
      onGlobalUserTouch {
          timers.startLockTimer()
      }
  //end pseudocode
  
      Loader {
          id: mainLoader
          anchors.fill: parent
          source: "FirstPage.qml"
          Behavior on opacity {PropertyAnimation{duration:250}}
          onLoaded: secondLoader.source = ""
      }
  
      states:[
          State {
              name:"SecondPage"
              when: (mainCppClass.state == PanelStates.SECOND_PAGE)
          PropertyChanges {
              target: mainLoader
              source: "SecondPage.qml"
              }
          }
      ]
  }
  </code></pre>
  
  <p>All I was able to find on the web was how to implement this in either iOS or Android.</p>