bool QListModel
::dropMimeData(const QMimeData *data, Qt
::DropAction action,
{
Q_UNUSED(column);
if (index.isValid()) row = index.row();
else if (row == -1) {
row = lst.count();
}
return view->dropMimeData(row, data, action);
}
{
int row = index;
int column = 0;
// QAbstractListModel::dropMimeData will overwrite on the index if row == -1 and column == -1
idx = model()->index(row, column);
row = -1;
column = -1;
}
return d_func()->model()->QAbstractListModel::dropMimeData(data, action , row, column, idx);
}
bool QListModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &index)
{
Q_UNUSED(column);
QListWidget *view = ::qobject_cast<QListWidget*>(QObject::parent());
if (index.isValid()) row = index.row();
else if (row == -1) {
row = lst.count();
}
return view->dropMimeData(row, data, action);
}
bool QListWidget::dropMimeData(int index, const QMimeData *data, Qt::DropAction action)
{
QModelIndex idx;
int row = index;
int column = 0;
if (dropIndicatorPosition() == QAbstractItemView::OnItem) {
// QAbstractListModel::dropMimeData will overwrite on the index if row == -1 and column == -1
idx = model()->index(row, column);
row = -1;
column = -1;
}
return d_func()->model()->QAbstractListModel::dropMimeData(data, action , row, column, idx);
}
To copy to clipboard, switch view to plain text mode
Bookmarks