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

Regression in childMouseEventFilter after wip/pointerhandler => dev merge

    XMLWordPrintable

Details

    • 2dd530ca35032465d4e928aa7c8f29563eb0c5da 526fb971ae9a2a6c8fce27883d9c62a9ea16bcdf (autotest) 309170a7f97759aa3f2e25a6c5202a6438a8bf4f

    Description

      The Test item receives release events in 5.9, but not in dev:

      main.cpp
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QDebug>
      #include <QtQuick>
      
      class Test : public QQuickItem
      {
          Q_OBJECT
      
      public:
          Test() {
              setFiltersChildMouseEvents(true);
              setAcceptedMouseButtons(Qt::LeftButton);
          }
      
          bool childMouseEventFilter(QQuickItem *item, QEvent *event) {
              qDebug() << Q_FUNC_INFO << item << event;
              return true;
          }
      };
      
      int main(int argc, char *argv[])
      {
          QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
          QGuiApplication app(argc, argv);
      
          qmlRegisterType<Test>("App", 1, 0, "Test");
      
          QQmlApplicationEngine engine;
          engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
          if (engine.rootObjects().isEmpty())
              return -1;
      
          return app.exec();
      }
      
      #include "main.moc"
      
      main.qml
      
      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      import App 1.0
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
      
          Test {
              anchors.fill: parent
      
              MouseArea {
                  anchors.fill: parent
                  anchors.rightMargin: parent.width / 2
      
                  Rectangle {
                      anchors.fill: parent
                      color: "red"
                  }
              }
          }
      }
      
      Starting /home/mitch/dev/temp/quick-qt5_9_debug-Debug/quick...
      QML debugging is enabled. Only use this in a safe environment.
      virtual bool Test::childMouseEventFilter(QQuickItem*, QEvent*) QQuickMouseArea(0x74b900, parent=0x74b6c0, geometry=0,0 320x480) QMouseEvent(MouseButtonPress, LeftButton, localPos=174,235.5, screenPos=231,281)
      virtual bool Test::childMouseEventFilter(QQuickItem*, QEvent*) QQuickMouseArea(0x74b900, parent=0x74b6c0, geometry=0,0 320x480) QMouseEvent(MouseButtonRelease, LeftButton, localPos=174,235.5, screenPos=231,281)
      virtual bool Test::childMouseEventFilter(QQuickItem*, QEvent*) QQuickMouseArea(0x74b900, parent=0x74b6c0, geometry=0,0 320x480) QEvent(UngrabMouse, 0x7ffd4f7a78c0)
      /home/mitch/dev/temp/quick-qt5_9_debug-Debug/quick exited with code 0
      
      Starting /home/mitch/dev/temp/quick-qt5_dev_debug-Debug/quick...
      QML debugging is enabled. Only use this in a safe environment.
      Empty filename passed to function
      virtual bool Test::childMouseEventFilter(QQuickItem*, QEvent*) QQuickMouseArea(0xe550b0, parent=0xe54e50, geometry=0,0 320x480) QMouseEvent(MouseButtonPress, LeftButton, localPos=205.5,276.5, screenPos=262.5,322)
      /home/mitch/dev/temp/quick-qt5_dev_debug-Debug/quick exited with code 0
      

      Attachments

        Issue Links

          Activity

            People

              srutledg Shawn Rutledge
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: