Accepting drops on a QGraphicsScene

前端 未结 1 636
渐次进展
渐次进展 2021-01-17 18:09

I\'m trying to implement drag\'n\'drop for a QGraphicsScene. Here are the events I\'ve overloaded:

void TargetScene::dragEnterEvent(QGraphicsSce         


        
相关标签:
1条回答
  • 2021-01-17 18:44

    The trick here is to ALSO accept the event in the QGraphicsScene::dragMoveEvent()!

    The reason is the DEFAULT implementation which ignores drag and drop events if there is no item under the mouse!

    Also refer to: http://www.qtcentre.org/threads/8022-QGraphicsScene-doesn-t-accept-Drops

    Cheers

    0 讨论(0)
提交回复
热议问题