Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Intercepting and relaying touch events to child items
Qt 6.12 LTS is out! See what's new in the release blog

Intercepting and relaying touch events to child items

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.1k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi Folks,
    I'm a newbie to Qt, trying to recreate some custom touch processing code. Can you set up a MultiPointTouchArea to intercept touch events, then selectively pass those events on to child items, all within QML? Specifically, I have a ListView that should scroll when I swipe vertically, but I would like to be able to reposition the ListView horizontally if the user's touch moves horizontally. I have tested this with embedding a ListView in a Flickable object, which works for one ListView, but I have a number of ListViews (panes on a multitiered browsing tree) that need to be laid out with respect to the moving ListView.

    I envision something like thise:

    @ListView {
    id: firstList
    // details
    }

    MultiPointTouchArea {
    touchPoints: [
    TouchPoint { id: point1 }
    ]
    onPressed:
    {
    if ( /* test for horizontal move */ )
    firstList.x: point1.x
    else
    firstList.onPressed(point1)
    }
    }@

    Is this possible in QML or do I need to work this kind of logic in C++ with signals and slots instead? Thanks a ton for the help.
    Cheers,
    Dave

    1 Reply Last reply
    0

    • Login

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