Hi,
I have created a QStandardItemModel for QTreeView and will update some item's data when some data changed. Everything is ok except when set data to the first visible item, it will cause the program exit in abnormal. the code as below:
I just want to update the panel data (1920x1080) according panel's width or height change. I'm sure rootItems.at(1) is pointed to the data (1920x1080), please see below picture,Qt Code:
{ else rect.setHeight(t); panel->setRect(rect); rootItems.at(1)->setData(s, Qt::DisplayRole); qDebug() << rootItems.at(0)->data(Qt::DisplayRole).toString() << ":" << rootItems.at(1)->data(Qt::DisplayRole).toString(); scene->update(); }To copy to clipboard, switch view to plain text mode
error.png
anyone has suggestion? thanks.
Bookmarks