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

QQuickWidget should respect if the mappedMouseEvent is ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.3.1
    • Quick: Widget
    • None
    • Windows 7

    Description

      QQuickWidget creates mapped events to send to the d->offscreenWindow()

      If the user ignores the mouseEvent in a MouseArea underneath, they can set accepted == false. If the mapped event returns with an ignored state, it should tell the unmapped event that it's state is also ignored?

      I.e.

      Currently:

      void QQuickWidget::mousePressEvent(QMouseEvent *e)
      {
         Q_D(QQuickWidget);
         Q_QUICK_PROFILE(addEvent<QQuickProfiler::Mouse>());
         QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(),    e->button(), e->buttons(), e->modifiers());
         QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
      }
      

      Possible solution?:

      void QQuickWidget::mousePressEvent(QMouseEvent *e)
      {
         Q_D(QQuickWidget);
         Q_QUICK_PROFILE(addEvent<QQuickProfiler::Mouse>());
         QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers());
         QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
         e->setAccepted(mappedEvent->isAccepted());
      }
      

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            lmv Luke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes