mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
parent
0182a43b8e
commit
47b55ba164
|
@ -438,7 +438,18 @@ class abstractModel(QAbstractItemModel):
|
|||
|
||||
for item in items:
|
||||
if item.ID() in IDs:
|
||||
item.getUniqueID(recursive=True)
|
||||
# Items don't get new IDs, because they are not part of a model yet,
|
||||
# so the following call does nothing:
|
||||
# item.getUniqueID(recursive=True)
|
||||
|
||||
# Instead we need to remove IDs (recursively) in all copied items, so that they
|
||||
# will receive new ones when inserted within the model.
|
||||
def removeIDs(i):
|
||||
i.setData(item.enum.ID, None)
|
||||
for c in i.children():
|
||||
removeIDs(c)
|
||||
|
||||
removeIDs(item)
|
||||
|
||||
r = self.insertItems(items, beginRow, parent)
|
||||
|
||||
|
|
Loading…
Reference in a new issue