Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Receiving touch-events anywhere on the screen and then passing them on

    QML and Qt Quick
    qml touchscreen
    2
    2
    960
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thealse last edited by thealse

      I have a qt 5.8 / qml QtQuick 2.4 application for single touchscreen devices.

      I would like to implement a function so that when the user has not touched anywhere on the screen for a certain time, the screen should dim down.

      I don't know how to implement a handler that receives all touches anywhere on the screen and then passes them on, not even sure if it is possible!

      I was thinking of putting a MouseArea covering the whole screen and then using the onPressed but I don't know to pass the touch-event on to the children underneath it.

      1 Reply Last reply Reply Quote 0
      • B
        benh last edited by

        For your screen mouse area, have you tried this?

            MouseArea {
                anchors.fill: parent
                onPressed:
                {
                    // your stuff here, e.g. global timeout reset
                    mouse.accepted = false;
                }
            }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post