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

Add a convenience event forwarder to QQuickRenderControl

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Quick: Other
    • None

    Description

      When using QQuickRenderControl one is supposed to manually forward events to the target QQuickWindow. Pointer events (mouse, etc.) seem to require some mapping in order to account with the fact that there's no real scene, for instance the examples do:

       

      void WindowSingleThreaded::mousePressEvent(QMouseEvent *e)
      {
          // Use the constructor taking position and globalPosition. That puts position into the
          // event's position and scenePosition, and globalPosition into the event's globalPosition. This way
          // the scenePosition in e is ignored and is replaced by position. This is necessary
          // because QQuickWindow thinks of itself as a top-level window always.
          QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers());
          QCoreApplication::sendEvent(m_quickWindow, &mappedEvent);
      }
      
      

      It would be more appropriate to have an event forwarder utility method on QQuickRenderControl ,so that it can do any necessary modifications to input events internally.

      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
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes