Qt drag indicator

I have a class that extends from QTreeView, which has a data model that extends from QAbstractItemModel, and I want to drag an element to it.

My problem is that when I drag, my drag indicator is displayed, and it displays either a rectangle that needs to be dropped on the element, or a line that needs to be deleted between the elements. However, when I get dropMimeData in my data model, I see no way to get this data. I noticed that QAbstractItemView has dropIndicatorPosition, but it is protected. So my question is: how can I find out in dropMimeData if the drop is on the element, before or after it?

+2
source share
1 answer

, :

bool MyModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
                  int row, int column, const QModelIndex &parent)

QModelIndex ( parent.row(), parent.column() -1), , , , .

, -1, , .

qt docs " " - .

+3

All Articles