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

QDrag on QGraphicsScene do not invokes dragLeaveEvent for QGraphicsProxyWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1
    • Widgets: GraphicsView
    • None
    • Windows 8.1
      Qt Creator 3.5.1 (opensource)
      Based on Qt 5.5.1 (MSVC 2013, 32 bit)

      Built on Oct 15 2015 01:55:47

      From revision b4c52505ca

    Description

      I have QGraphicsScene that shows QWidget(s) via QGraphicsProxyWidget.
      Widgets can exchange data through D&D. Widget produces QDrag item according to docs.

      When QDrag object leaves area of QGraphicsProxyWidget I expect to receive dragLeaveEvent() for the particular proxy widget. But it happens not always.

      IF the scene ACCEPTS event in the dragMoveEvent() outside the area of proxy then dragLeaveEvent() DO NOT INVOKES in the proxy.

      IF the scene DO NOT ACCEPT event in the dragMoveEvent() outside the area of proxy then dragLeaveEvent() INVOKES.

      Pseudo graphic:

      A B C

      A - the pixel inside proxy
      B - the border of proxy
      C - the scene area

      I drag item from A to C and expect for dragLeaveEvent() in the proxy. But if QDrag is 'accepted' in points A and in the point C then no event. If QDrag is 'accepted' in A and 'rejected' in C dragLeaveEvent() happens in the proxy.

      Is this expected behaviour? As for me dragLeaveEvent() should be invoked in both cases.

      In the attached simple example to confirm the issue need to change flag
      bool acceptOnBlank
      if true - the event handler

      void dragLeaveEvent( QGraphicsSceneDragDropEvent* /event/ ) override

      { qDebug() << "dragLeaveEvent"; }

      will never be invoked.

      Attached file can be used in the 'Dialog Window' project of QtCreator

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            yura-vel Yuriy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes