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. PinchArea and MouseArea
Qt 6.11 is out! See what's new in the release blog

PinchArea and MouseArea

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • D Offline
    D Offline
    DeltaSim
    wrote on last edited by
    #1

    Hi,

    I have an issue mixing PinchArea and MouseArea.
    Qt Version: 5.12.0
    Example Code:

    PinchArea
    {
       id:pinchArea
       widht:1280
       height:800
       onPinchStarted: {
          console.log("pinch started");
       }
       onPinchFinished: {
          console.log("pinch finished");
       }
       onPinchUpdated: {
          console.log("Update"+scale);
       }
    
       MouseArea
       {
          id: mouseA
          anchors.fill: parent
          onPressed: console.log("mouseArea pressed");
          onReleased: console.log("MouseArea released");
       }
    }
    

    PinchArea works fine, Start, Update and Finish events are triggered.

    The problem is with MouseArea, before PinchArea takes the event, mousearea.pressed is triggered.
    But mousearea.released event is never triggered, even after pincharea.finished.

    Is it a Qt bug ?
    Do you know a workaround ?

    Thanks,

    S 1 Reply Last reply
    0
    • D DeltaSim

      Hi,

      I have an issue mixing PinchArea and MouseArea.
      Qt Version: 5.12.0
      Example Code:

      PinchArea
      {
         id:pinchArea
         widht:1280
         height:800
         onPinchStarted: {
            console.log("pinch started");
         }
         onPinchFinished: {
            console.log("pinch finished");
         }
         onPinchUpdated: {
            console.log("Update"+scale);
         }
      
         MouseArea
         {
            id: mouseA
            anchors.fill: parent
            onPressed: console.log("mouseArea pressed");
            onReleased: console.log("MouseArea released");
         }
      }
      

      PinchArea works fine, Start, Update and Finish events are triggered.

      The problem is with MouseArea, before PinchArea takes the event, mousearea.pressed is triggered.
      But mousearea.released event is never triggered, even after pincharea.finished.

      Is it a Qt bug ?
      Do you know a workaround ?

      Thanks,

      S Offline
      S Offline
      Simon Fojtu
      wrote on last edited by
      #2

      @DeltaSim The event you are looking for is onCancelled. This is called when the PinchArea steals the event from the MouseArea.

      1 Reply Last reply
      1

      • Login

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