Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TapHandler and stacked Panes

TapHandler and stacked Panes

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 1 Posters 351 Views 1 Watching
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    Consider the following example:

    import QtQuick
    import QtQuick.Controls
    import QtQuick.Layouts
    Window {
        width: 640
        height: 480
        visible: true
        Pane {
            height: 100
            width: 100
            background: Rectangle { color: 'red' }
            Pane {
                anchors.centerIn: parent
                height: 50
                width: 50
                background: Rectangle { color: 'blue' }
            }
            TapHandler {
                onTapped: console.log("tapped!")
            }
        }
    }
    

    I want the TapHandler to operate on all of the outer Pane, but as coded, it doesn't accept clicks on the inner Pane. Any ideas on how to fix this?

    Thanks...

    1 Reply Last reply
    0
    • mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by mzimmers
      #2

      I was able to obviate this problem by using Rectangle instead of Pane, but I'm still curious as to whether there's a way to enable the entire "outer" control (including the area of the inner Pane) to receive the TapHandler signal.

      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        Evidently, there's no automatic way to get a control to pass a signal onto its parent control. So, I'll have to be careful about which QML objects I choose when constructing a complex control.

        1 Reply Last reply
        0
        • mzimmersM mzimmers has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved