def supportedDragActions(self): if self.owner.role == 'search': return QtCore.Qt.CopyAction if self.owner.role == 'playlist': return QtCore.Qt.MoveAction def flags(self, index): defaultFlags = QtCore.QAbstractItemModel.flags(self, index) if index.isValid(): return QtCore.Qt.ItemIsDragEnabled | defaultFlags | QtCore.Qt.ItemIsDropEnabled else: return QtCore.Qt.ItemIsDropEnabled | defaultFlags def supportedDropActions(self): if self.owner.role == 'search': return QtCore.Qt.IgnoreAction if self.owner.role == 'playlist': return QtCore.Qt.MoveAction | QtCore.Qt.CopyAction