mstegehu
2nd February 2010, 15:14
Hello,
I have a problem almost simular as in Thread 26498 Crash after selectionModel (http://www.qtcentre.org/threads/26498-application-crushes-after-performing-selectionModel()-from-tableView).
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::RemoveModelClick edGS() Line 713 C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::qt_metacall(QMet aObject::Call _c=InvokeMetaMethod, int _id=7, void * * _a=0x0468c4b4) Line 175 + 0x8 bytes C++
void Class::RemoveModelClickedGS ()
{
QItemSelectionModel *selectionModel = m_implantSelectionTableWidget->selectionModel();
QModelIndexList indexes = m_selectionModel->selectedIndexes();
foreach(index, indexes)
{
m_implantModel->removeRows ((*it).row(), 1, (*it).parent());
}
}
Has anyone an idea what causes the crash?
I have a problem almost simular as in Thread 26498 Crash after selectionModel (http://www.qtcentre.org/threads/26498-application-crushes-after-performing-selectionModel()-from-tableView).
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::RemoveModelClick edGS() Line 713 C++
MBRSAGUI.dll!MBRSA_RSA_ScenePane::qt_metacall(QMet aObject::Call _c=InvokeMetaMethod, int _id=7, void * * _a=0x0468c4b4) Line 175 + 0x8 bytes C++
void Class::RemoveModelClickedGS ()
{
QItemSelectionModel *selectionModel = m_implantSelectionTableWidget->selectionModel();
QModelIndexList indexes = m_selectionModel->selectedIndexes();
foreach(index, indexes)
{
m_implantModel->removeRows ((*it).row(), 1, (*it).parent());
}
}
Has anyone an idea what causes the crash?