I have also tried the following:
{
if (!index.isValid())
return false;
if (role != Qt::EditRole)
return false;
RootItem *item = getRootItem(index);
item->setData(index.column(),value);
emit dataChanged(index, index);
return true;
}
bool RootModel::setData ( const QModelIndex & index, const QVariant & value, int role)
{
if (!index.isValid())
return false;
if (role != Qt::EditRole)
return false;
RootItem *item = getRootItem(index);
item->setData(index.column(),value);
emit dataChanged(index, index);
return true;
}
To copy to clipboard, switch view to plain text mode
Where item->setData() changes the value held in the item. Again if I click on an item it will reflect the change (on on another window) but not otherwise.
Bookmarks