Hi
I can append the dragged item as sibling on my own in dropMimeData(). So it is not important that there is a dropindicator between the items...
But I have another problem:
My QMimeData Object contains the internalPointer of my the dragged item. And the internal pointer has a QDomNode member.
So have all things I need. The parent-Node, the parent-Index, the child-Node, the childI-index, the sibling-index and subling-Node. In dropMimeData() I append the the dragged node with the following code:
siblingNode.parentNode().removeChild(newNode);
siblingNode.parentNode().insertAfter(newNode,siblingNode);
siblingNode.parentNode().removeChild(newNode);
siblingNode.parentNode().insertAfter(newNode,siblingNode);
To copy to clipboard, switch view to plain text mode
The underlaying xml doc is now correct, but the QAbstractItemModel doesn't update. I tried everything beginRemoveRows() and endRemoveRows(), beginInsertRows(), endInsertRows().
I emit dataChanged() with the parent index, but nothing is updated.
What I have to do? Do I have reimplement insertRows and removeRows. I read that this is not necessary if I remove and insert data by myself...
thank you
Bookmarks