Do you mean that your dropMimeData() implementation doesn't get called at all? Then there must be something wrong because QDirModel surely does the dropping work in dropMimeData().

Btw, your flags() shouldn't be necessary. QDirModel already adds Qt::ItemIsDropEnabled where appropriate:
Qt Code:
  1. Qt::ItemFlags QDirModel::flags(const QModelIndex &index) const
  2. {
  3. Q_D(const QDirModel);
  4. Qt::ItemFlags flags = QAbstractItemModel::flags(index);
  5. if (!d->indexValid(index))
  6. return flags;
  7. flags |= Qt::ItemIsDragEnabled;
  8. if (d->readOnly)
  9. return flags;
  10. QDirModelPrivate::QDirNode *node = d->node(index);
  11. if ((index.column() == 0) && node->info.isWritable()) {
  12. flags |= Qt::ItemIsEditable;
  13. if (fileInfo(index).isDir()) // is directory and is editable
  14. flags |= Qt::ItemIsDropEnabled; // <---
  15. }
  16. return flags;
  17. }
To copy to clipboard, switch view to plain text mode