def dragEnterEvent(self, event): if event.source() is self: return else: data = event.mimeData() links = connector.loadMimeData(data) # drag to ourself or already contained? if any([l.doc() == self.__parent.doc() for l in links]): return QtGui.QTreeView.dragEnterEvent(self, event)
def dropMimeData(self, data, action, row, column, parent): if not self.__mutable: return True if action == QtCore.Qt.IgnoreAction: return True if data.hasFormat(connector.LINK_MIME_TYPE): return self.__dropLinks(connector.loadMimeData(data)) if data.hasFormat('text/uri-list'): return self.__dropFile(data, parent) if data.hasFormat('FileContents'): return self.__dropContents(data) return False