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

remaining issues in QEvent classes in Qt 6

    XMLWordPrintable

Details

    Description

      QKeyEvent::modifiers() shadows QInputEvent::modifiers(), but it's not virtual. It could be a proper virtual override.

      We intended to remove all non-user-facing setters, but QInputEvent still has public setModifiers() and setTimestamp(), and QPointerEvent overrides setTimestamp(). These should either be private (accessible to friends only) or moved to QMutable*Event classes; but we don't have a QMutableInputEvent.

      QPointerEvent::setAccepted() is a virtual override that sets the QEventPoint accepted state in the same way, so that legacy code that accepts an entire event is compatible with delivery code in QQuickWindow that is checking whether each point is accepted. But QEvent::accept() and ignore() are not virtual and do not do that. It's inconsistent, but fixing it would pessimize the implementation, so maybe we should just live with that one. (I suspect the whole reason that accept() and ignore() exist is that the implementation only takes one instruction, even if m_accept is in a bitfield: much more efficient than setAccepted() could be. But now m_accept is no longer in a bitfield. We have a tradition of thrashing this flag back and forth a lot during delivery: set it to true before visiting an item or widget, then the item or widget sets it back to false again, and usually there are more of them to visit after that.)

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes