Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80681

scale: 0 items handle the mouse

    XMLWordPrintable

Details

    Description

      The following example can be used to demonstrate:

      import QtQuick 2.14
      
      Item {
          width: 400
          height: 400
      
          Rectangle {
              width: 200
              height: 200
              color: "red"
              scale: 0 // any scale other than 0 works as expected
      
              TapHandler { onTapped: console.log("tapped") }
          }
      }
       

      With any scale value other than 0, "tapped" is only output when clicking within the visual red Rectangle. With a scale value of 0, "tapped" is output as though the item were of scale 1.

      This appears to be due to the interaction of https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp.html#2456 and contains(). (with a scale of 0, mapFromScene returns the original value, which contains() happily accepts.) 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mbrasser Michael Brasser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes