mirror of
https://github.com/huderlem/porymap.git
synced 2026-07-18 16:32:15 -05:00
fix dropping groups beyond end of group list
The issue was that the end-of-list drop zone is quite small
and groups were being dropped outside of the bounds of the mapList
This commit is contained in:
parent
29f88e6b76
commit
632eeef53f
|
|
@ -277,6 +277,11 @@ bool MapGroupModel::dropMimeData(const QMimeData *data, Qt::DropAction action, i
|
|||
if (parentIndex.row() != -1 || parentIndex.column() != -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (row < 0) {
|
||||
row = this->rowCount(parentIndex);
|
||||
}
|
||||
|
||||
QByteArray encodedData = data->data("application/porymap.mapgroupmodel.group");
|
||||
QDataStream stream(&encodedData, QIODevice::ReadOnly);
|
||||
QString groupName;
|
||||
|
|
@ -296,7 +301,6 @@ bool MapGroupModel::dropMimeData(const QMimeData *data, Qt::DropAction action, i
|
|||
}
|
||||
|
||||
this->insertRow(row, parentIndex);
|
||||
|
||||
QModelIndex groupIndex = index(row, 0, parentIndex);
|
||||
QStandardItem *groupItem = this->itemFromIndex(groupIndex);
|
||||
createMapFolderItem(groupName, groupItem);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user