PDA

View Full Version : Qt 4.7.2: QTreeView + QFileSystemModel: Dragging on Windows



agarny
5th April 2011, 13:40
Hi, I have implemented some kind of a file browser in my application using QTreeView and QFileSystemModel. All works fine, except when it comes to dragging folders/files from my QTreeView, and this on Windows (it's fine on Linux while I haven't got a chance to try it on Mac OS X yet).

My QTreeView is customised as follows:


setAllColumnsShowFocus(true);
setDragDropMode(QAbstractItemView::DragOnly);
setModel(mFileSystemModel);
setSelectionMode(QAbstractItemView::ExtendedSelect ion);
setSortingEnabled(true);
setUniformRowHeights(true);If I try to drag a folder, then there is a gap between the Name and Type information (i.e. an empty space for the Size information), as can be seen in the following screenshot:

6192

In fact, it's the same with a file:

6193

As one can see, Qt actually paints the cells individually rather than the whole row. So... is there any way to get things to work 'properly' (i.e. as on Linux) or is that a bug on Windows?