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

Export qt_sendSpontaneousEvent

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.15.6
    • None
    • All

    Description

      Might end up being a dupe of https://bugreports.qt.io/browse/QTBUG-71449, depending on how it's implemented.  Basically, we'd like to unit/module test that the wheel event gets propagated to the parent widget.  In QT 5.1x, this was fine.  We didn't need worry about the spontaneous flag for the event to move up the ancestor chain.  However, in 5.15, the following `if` statement was moved up from an `else if` in `QApplication::notify()` for the `QEvent::Wheel` case:

       

      if (!spontaneous)

      { // wheel_widget may forward the wheel event to a delegate widget, // either directly or indirectly (e.g. QAbstractScrollArea will // forward to its QScrollBars through viewportEvent()). In that // case, the event will not be spontaneous but synthesized, so // we can send it straight to the receiver. wheel->ignore(); res = d->notify_helper(w, wheel); }

      else if (phase == Qt::NoScrollPhase || phase == Qt::ScrollBegin || !QApplicationPrivate::wheel_widget) 

      .

      .

      .

      Thus, the `else if` which contains the propagation up the ancestor chain isn't hit in the non-spontaneous case.  This is fine, but it makes testing the spontaneous case impossible, as far as I can tell.  In unit/module testing, even if we set the spontaneous flag (which we can via `QSpontaneKeyEvent::setSpontaneous()`), only `QCoreApplication::sendEvent()` is accessible, and that function automatically falsifies the flag.  We unit/module test just our piece of the event handler, but we'd prefer to be able to still test the experience with the QT integration at this level.

      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
            andykim Andy Kim
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes