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. MouseArea and underlying elements: events
Forum Updated to NodeBB v4.3 + New Features

MouseArea and underlying elements: events

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 294 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.
  • G Offline
    G Offline
    Geraud
    wrote on last edited by
    #1

    Hi,

    I am trying to create a "page" with the following properties:

    The page can have any kind of controls, buttons, text fields, sliders etc.

    But on a long press anywhere on it, I should be able to react and do something that is unique to the page.

    I am trying to get it to work with a MouseArea covering the whole page, then settings the mouse.accepted to false for onClicked and handing only onPressedAndHold, but that does not work.

    After experimenting, I have realized that the only way to get the underlying controls to work, is to set mouse.accepted to false for onPressed.

    The problem then is that onPressedAndHold will never be called.

    I thought about starting a timer onPressed that would trigger after 800ms (the time for a long press) and get cancelled if released happened anywhere else, but the problem is that once you "accepted = false" onPressed, then onRelease is automatically ignored as well.

    As I want to create a generic solution without having to individually set each and every "onSomething" from the "base controls" under the MouseArea, having them call a function to let the Timer know "this was handled" is really not an option.

    Any ideas there?

    Thank you.

    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 Extensions
    • Unsolved