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

MouseArea with hoverEnabled set to true makes wrong QMouseEvent source

    XMLWordPrintable

Details

    • Android, Linux/X11

    Description

      When having a MouseArea with hoverEnabled property set to true like:

      MouseArea {
         onClicked: {
            ...
         } 
      
         hoverEnabled: true
      }
      

      and installing an event filter to qApp like:

      bool MyObject::eventFilter(QObject*, QEvent* event) {
          if (dynamic_cast<QMouseEvent*>(event)) {
              qDebug() << dynamic_cast<QMouseEvent*>(event)->source();
          }
          return false;
      }
      

      tapping on the mouse area on android shows an event of type QEvent::MouseMove
      with Qt::MouseEventNotSynthesized as the source which is wrong as it's synthesized with touch screen.

      I have also set Qt::AA_SynthesizeTouchForUnhandledMouseEvents before creating QApplication but it acts the same.

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            nejatafshar Nejat Afshar
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes