Hello,

I am developing a class using a QTableWidget and, although I re-installed Qt 4.1.1 and rebuilt my project several times to avoid inconsistent build problems, I get a "user breakpoint", when the QModelIndex destructor is invoked in the following method:

Qt Code:
  1. void MyClass::foo()
  2. {
  3. QList<QModelIndex> indexes = pAEditor_->tableWidget->selectionModel()->selectedIndexes();
  4. pAEditor_->btnOne->setDisabled( indexes.count() <= 0 );
  5. pAEditor_->btnTwo->setDisabled( indexes.count() <= 0 );
  6. }
To copy to clipboard, switch view to plain text mode 

The user breakpoint occurs on the following code in qatomic.h:

Qt Code:
  1. inline int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval)
  2. {
  3. return q_atomic_test_and_set_int(ptr, expected, newval);
  4. }
To copy to clipboard, switch view to plain text mode 

This is the call stack:

ntdll.dll!7c901230()
ntdll.dll!7c96c943()
ntdll.dll!7c96cd80()
ntdll.dll!7c960af8()
> QtCored4.dll!q_atomic_test_and_set_release_int(vol atile int * ptr=0x02cd0000, int expected=1073741920, int newval=85780576) Line 199 + 0x11 C++
kernel32.dll!7c85e7af()
Database.dll!_CrtIsValidHeapPointer(const void * pUserData=0x051ce880) Line 1807 C
Database.dll!_free_dbg_lk(void * pUserData=0x051ce880, int nBlockUse=1) Line 1132 + 0x9 C
Database.dll!_free_dbg(void * pUserData=0x051ce880, int nBlockUse=1) Line 1070 + 0xd C
Database.dll!operator delete(void * pUserData=0x051ce880) Line 54 + 0x10 C++
Database.dll!QModelIndex::`scalar deleting destructor'() + 0x46 C++
Database.dll!QList<QModelIndex>::node_destruct(QLi st<QModelIndex>::Node * from=0x051ce834, QList<QModelIndex>::Node * to=0x051ce834) Line 330 + 0x3e C++
Database.dll!QList<QModelIndex>::free(QListData:ata * data=0x051ce820) Line 528 C++
Database.dll!QList<QModelIndex>::~QList<QModelInde x>() Line 502 C++
Database.dll!MyClass::Foo() Line 381 + 0xf C++



Now, I know this is all a little vague, but does someone have any suggestions on how to solve this?

Tnx,
Arthur