PDA

View Full Version : drag and drop problems



ianbd
21st November 2008, 14:31
Hey ho

I am trying to add dragging to a QTreeView containg a QDirModel model but I cannot seem to get entries in the tree to register as draggable. I have read the assistant information and searched the tintinterweb, but the only stuff I can find is a little obscure. I have tried the ideas in the QT examples but I am getting nowhere fast. So, does anyone have an idiots guide to drag and drop in QT?

caduel
21st November 2008, 20:40
See QAbstractItemView::setDragEnabled();
The model (or its items) has to support dragging as well (by implmenting mimeData() and returning the apropriate QAbstractItemModel::flags(). I guess QDirModel does that already.

HTH