Tag Archives: qt

(C++) Qt drag and drop files or directories

You have to implement 2 protected virtual methods in your widget you want to accept file or directory drops: – void dragEnterEvent(QDragEnterEvent *event) – void dropEvent(QDropEvent *event) And also you have to call setAcceptDrops(true); on this widget before it could accept drops.

Posted in C++ | Also tagged , , , , , , | Leave a comment