PDA

View Full Version : QFileSystemModel with Drag&Drop operations



eklekt
18th February 2011, 09:01
Hello! Can you help me or give some advices?

I need to use QTreeView with QFilesSytemModel and I want to enable drug&drop operations on files and folders( e.g. move one file to another folder or something like this ).

For make it, I need to write new class which is inherited from QFileSystemModel class. And I need to reimplement some methods there, like:
Qt::ItemFlags flags(const QModelIndex &index) const;
Qt::DropActions supportedDropActions() const;
Qt::DragActions supportedDragActions() const;

But QFileSystem class doesn't allow to make inherited class, there are no virtual methods.
What can I do in this situation? Rewrite new QFileSystemModel class or what?

Added after 26 minutes:

Sorry for this question, this methods are virtual. It has a virtual key word in QAbstractItemModel class, but i looked it for in QFileSystemModel class.