Hi all, I'm having some trouble implementing drag & drop in a MDI app. My app is a QMainWindow widget which has a QMdiArea as the central widget.

In this QMdiArea I create one QMdiSubWindow and assign a custom QWidget to it using QMdiSubWindow->setWidget().

The problem is that I don't receive any dragEnter or drop events in any of all these widgets. Here's what I've done in the code for the QMainWindow, QMdiArea, QMdiSubWindow and the custom QWidget:

1.- Set the acceptDrops flag using setAcceptDrops(true);
2.- Implemented the dragEnterEvent, dropEvent and dragMoveEvent:

Qt Code:
  1. void mainWND::dragEnterEvent(QDragEnterEvent* event)
  2. {
  3. qDebug()<<"mainWND::dragEnterEvent";
  4. //if (event->mimeData()->hasFormat("text/uri-list"))
  5. event->acceptProposedAction();
  6. }
  7.  
  8. void mainWND::dropEvent(QDropEvent* event)
  9. {
  10. qDebug()<<"mainWND::dropEvent";
  11. //this->slProcessFileDrop(event->mimeData()->data("text/uri-list"));
  12. event->acceptProposedAction();
  13. }
  14.  
  15. void mainWND::dragMoveEvent(QDragMoveEvent* event)
  16. {
  17. qDebug()<<"mainWND::dragMoveEvent";
  18. event->accept();
  19. }
To copy to clipboard, switch view to plain text mode 
(code shown here is from the QMainWindow widget, but I have the same code in all the other widgets).

As I said, I don't receive any events, not a single qDebug() statement is executed.

Could anyone throw some light in here? Am I missing anything? I've read all the documentation about QMdiArea and QMdiSubWindow but it says nothing about the drag & drop.

Thanks a lot!