How to drag&drop SVG elements?

Hello, I’m back with a new question. :slightly_smiling_face:

How can I implement drag&drop operation if the operation is going to be done on an SVG canvas? It’s an SVG chessboard and I want to implement drag&drop for chess piece elements. How can I implement the drag&drop operation using PyQt6? :thinking:

Always interesting questions :smiley:

When you say a SVG canvas what do you mean? My default approach for something like this would be using QGraphicsScene to display the SVG objects and handle the drag/drop behavior there. Or are you displaying it already in some other way?

Yes, I am already displaying the chessboard (my SVG canvas) with the load() method of the QSvgWidget class. Is this something that can be done, or is QGraphicsScene inevitable to be implemented for the drag&drop functionality?