Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15
-
None
Description
When a QListView is in IconMode, the drop indicator is never painted, not even when its show property is true. This effects the drag and drop puzzle examples.
#if QT_CONFIG(draganddrop) void QCommonListViewBase::paintDragDrop(QPainter *painter) { // FIXME: Until the we can provide a proper drop indicator // in IconMode, it makes no sense to show it dd->paintDropIndicator(painter); } #endif
The cause is due to an else statement in the private implementation. If the else statement is commented out, the drop indicator is correctly painted.
QAbstractItemView::DropIndicatorPosition QListViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const { /*if (viewMode == QListView::ListMode && flow == QListView::LeftToRight) else return QAbstractItemViewPrivate::position(pos, rect, idx); *// << COMMENT THIS OUT to fix drop indicator return static_cast<QListModeViewBase *>(commonListView)->position(pos, rect, idx); }
Please comment the else statement and allow the drop indicator to correctly be painted.