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/Button: Prevent double click and clicking on multiple buttons in a row
QtWS25 Last Chance

MouseArea/Button: Prevent double click and clicking on multiple buttons in a row

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 2.3k Views
  • 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.
  • C Offline
    C Offline
    CarolaC
    wrote on last edited by
    #1

    Hello,

    I use a stackview to switch between views and I use several MouseAreas as buttons (not the QML Button type) to navigate through the views. The problem is, that I can double click on MouseAreas and then the code in the onClicked slot is executed twice. I know that there is the onDoubleClick slot, but I noticed that the onClicked and the onDoubleClicked slots both receive a signal when I perform a double click, so that doesn't really help.

    I also want to prevent that I can hit on another MouseArea after I already clicked on one. I think the problem is that I have a (very short) transition in the stackview which gives the user the time to be able to click on two MouseAreas in one view, before the next view appears.

    Of course I could do all this manually with some flags, but I'd like to know if the framework provides something for these problems. Then I could save a lot of work ;) I also tried the QML Button type, but it's the same and it doesn't even provide a doubleClicked signal.

    Thanks.

    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