It has been a while since I have done any extensive work on a Microsoft platform, but in my recollection crtdbg.h can do many helpful diagnostic things, although it is sometimes tricky to get all the debug build settings configured in the way that will trigger the features you seek.
@Olivier-Ronat Thanks for checking, Olivier. Sorry to detain you to do that when I found it was my own fault. However, I learned some things and got a little better at debugging in Qt Creator.
I found the cause. I had a signal attached to the selectionModel of each row. Here's how I found out (note, I'm a newbie). On my Mac, I got the crash report and clicked a button to see what it was. This showed a callstack. I was able to see that it was complaining about setting text() from on_SelRow, and then I recalled that I had a signal connected on rows. So, I changed my code like so:
I was then able to remove rows without a crash. I just need to remember to add the signal back to the table when I add rows again.
You may also be wondering why I was intercepting a selected row. The reason was because then I could show a box above the table that showed the item detail in an easier to read format than having to scroll horizontally in the table to see all the columns. I was doing it like so:
void MainWindow::on_SelRow(QModelIndex oCurrRow, QModelIndex oPrevRow)
QTableWidget *t = dynamic_cast<QTableWidget *>(QObject::sender()->parent());
int y = oCurrRow.row();
// do something with t (table) and y (row index) variables
Hi, thanks for the reply. Yes, I set that flag to true but I can select a row by clicking indivual cell or horizontal header. I've overriden flags function in my model if I remove isSelectable flag i can't select anything.