Block dropping items on invisible root
This commit is contained in:
@@ -379,7 +379,9 @@ class ProjectModel(QAbstractItemModel):
|
|||||||
row: int, column: int, parent: QModelIndex
|
row: int, column: int, parent: QModelIndex
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Check if mime data can be dropped on the current location."""
|
"""Check if mime data can be dropped on the current location."""
|
||||||
return data.hasFormat(nwConst.MIME_HANDLE) and action == Qt.DropAction.MoveAction
|
if parent.isValid() and parent.internalPointer() is not self._root:
|
||||||
|
return data.hasFormat(nwConst.MIME_HANDLE) and action == Qt.DropAction.MoveAction
|
||||||
|
return False
|
||||||
|
|
||||||
def dropMimeData(
|
def dropMimeData(
|
||||||
self, data: QMimeData, action: Qt.DropAction,
|
self, data: QMimeData, action: Qt.DropAction,
|
||||||
|
|||||||
Reference in New Issue
Block a user