Hi!

I try to add values from a map to a QStandardItemModel, but my application is crashing. I have no idea why..

The last debug output is

QStandardItemModel::invisibleRootItem() const
The code is

Qt Code:
  1. QMap<QString, QString> map;
  2. QMapIterator<QString, QString> i(map);
  3. QList<QStandardItem*> rowList;
  4. QStandardItem *item = test->invisibleRootItem();
  5.  
  6.  
  7. while (i.hasNext()) {
  8. i.next();
  9. rowList << new QStandardItem(i.value());
  10. }
  11.  
  12. item->appendRow(rowList);
To copy to clipboard, switch view to plain text mode 

Can you tell me why this happens?

Kind regards,
HomeR