I've got a problem with my Qt 4.8 slot which is connected that way:
connect(ui->objectTree->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(syncGuiWithTreeSelection(const QItemSelection&, const QItemSelection&)));
the slot has this signature:
void MyClass::syncGuiWithTreeSelection(const QItemSelection &itemSelected, const QItemSelection &itemDeselected)
In the above slot I wanted to access the selected indexes like that:
const QModelIndexList &indexes = itemSelected.indexes();
Which works nicely BUT at the end of the slot, when the desctructor of QModelIndexList is called, a DEBUG_ASSERTION_FAILURE shows up. The call stack looks like that:
msvcr90d.dll!operator delete(void * pUserData=0x03673968) Line 52 + 0x51 bytes C++
MyClass.exe!QModelIndex::`scalar deleting destructor'() + 0x32 bytes C++
MyClass.exe!QList<QModelIndex>::node_destruct(QList<QModelIndex>::Node * from=0x0371c4c4, QList<QModelIndex>::Node * to=0x0371c4c8) Line 431 + 0x2f bytes C++
MyClass.exe!QList<QModelIndex>::free(QListData::Data * data=0x0371c4b0) Line 759 C++
MyClass.exe!QList<QModelIndex>::~QList<QModelIndex>() Line 733 C++
MyClass.exe!MyClass::syncGuiWithTreeSelection(const QItemSelection & itemSelected={...}, const QItemSelection & itemDeselected={...}) Line 853 + 0xc bytes C++
MyClass.exe!MyClass::qt_static_metacall(QObject * _o=0x001ef69c, QMetaObject::Call _c=InvokeMetaMethod, int _id=49, void * * _a=0x001eca04) Line 247 + 0x20 by
What can I do to be able to access the selected indexes?
kind regards, reinhart