An item can only belong to one model. This is why you need to create a copy of each element and put it in another model. You can do this using the QStandardItem::clone method.
This is an example for single-column models:
void copy(QStandardItemModel* from, QStandardItemModel* to) { to->clear(); for (int i = 0 ; i < from->rowCount() ; i++) { to->appendRow(from->item(i)->clone()); } }
EDIT:
Use to->removeRows(0, to->rowCount ()); instead of to->clear(); if you want to keep header data and column sizes in related views.
source share