Hello,
I have a problem almost simular as in Thread 26498 Crash after selectionModel.
I have a QTableView with custom Model and custom delegate. For adding and deleting rows I added two buttons and created a slot that calls the CustomModel to delete the row. I get a crash when the slots exits. It looks like a problem with the QModelIndexList.
msvcr90d.dll!operator delete(void * pUserData=0x088a6448) Line 52 + 0x51 bytes C++
MBRSAGUI.
dll!QModelIndex::`scalar deleting destructor
'() + 0x32 bytes C++ MBRSAGUI.dll!QList<QModelIndex>::node_destruct(QList<QModelIndex>::Node * from=0x0a194d8c, QList<QModelIndex>::Node * to=0x0a194d98) Line 359 + 0x2f bytes C++
MBRSAGUI.dll!QList<QModelIndex>::free(QListData::Data * data=0x0a194d78) Line 553 C++
MBRSAGUI.dll!QList<QModelIndex>::operator=(const QList<QModelIndex> & l=[0]()) Line 371 C++
MBRSAGUI.dll!QList<QModelIndex>::clear() Line 561 + 0x24 bytes C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::RemoveModelClickedGS() Line 713 C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=7, void * * _a=0x0468c4b4) Line 175 + 0x8 bytes C++
msvcr90d.dll!operator delete(void * pUserData=0x088a6448) Line 52 + 0x51 bytes C++
MBRSAGUI.dll!QModelIndex::`scalar deleting destructor'() + 0x32 bytes C++
MBRSAGUI.dll!QList<QModelIndex>::node_destruct(QList<QModelIndex>::Node * from=0x0a194d8c, QList<QModelIndex>::Node * to=0x0a194d98) Line 359 + 0x2f bytes C++
MBRSAGUI.dll!QList<QModelIndex>::free(QListData::Data * data=0x0a194d78) Line 553 C++
MBRSAGUI.dll!QList<QModelIndex>::operator=(const QList<QModelIndex> & l=[0]()) Line 371 C++
MBRSAGUI.dll!QList<QModelIndex>::clear() Line 561 + 0x24 bytes C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::RemoveModelClickedGS() Line 713 C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=7, void * * _a=0x0468c4b4) Line 175 + 0x8 bytes C++
To copy to clipboard, switch view to plain text mode
void Class::RemoveModelClickedGS ()
{
QModelIndexList indexes = m_selectionModel->selectedIndexes();
foreach(index, indexes)
{
m_implantModel->removeRows ((*it).row(), 1, (*it).parent());
}
}
void Class::RemoveModelClickedGS ()
{
QItemSelectionModel *selectionModel = m_implantSelectionTableWidget->selectionModel();
QModelIndexList indexes = m_selectionModel->selectedIndexes();
foreach(index, indexes)
{
m_implantModel->removeRows ((*it).row(), 1, (*it).parent());
}
}
To copy to clipboard, switch view to plain text mode
Has anyone an idea what causes the crash?
Bookmarks