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

QGraphicsView::dropEvent always returns the event 'accepted'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 4.8.1
    • Widgets: GraphicsView
    • None
    • Win7x64, VS2010

    Description

      When subclassing QGraphicsView::dropEvent, the call to the base class implementation (QGraphicsView::dropEvent) always results in the event being 'accepted', even if neither a QGraphicsItem, nor the QGraphicsScene itself handled the event.

      The reason seems to be that QGraphicsView::dropEvent creates a new event to be sent to the scene, and this event is based on a default-constructed QEvent.
      A default-constructed QEvent is accepted by default (see qcoreevent.cpp).

      Since no code handles ignoring the event if neither items nor scene uses it, the event stays accepted.

      Attachments

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

        Activity

          People

            bibr Andreas Aardal Hanssen
            asperamanca Robert Schimkowitsch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes