It depends what techniques you use in your program (for example the MVC pattern has its own support for D&D).

In most basic approach you need to use QMimeData to carry the data for you and dropEvent to handle the drop itself.