PDA

View Full Version : QTableWidget item in edit state crash when mouse cursor go over



Suppaman
9th December 2010, 09:35
Hi

I'mk facing a very strange problem in my application. I have a QTableWidget control and when I want to add a new item I use the following code:

QTableWidgetItem* pNewItem = new QTableWidgetItem();

ui->List->insertRow(0);
ui->List->setItem(0, 0, pNewItem);
ui->List->editItem(pNewItem);

I use this solution for allow the user to type the name of the new item directly into the edit field. This solution work but have a very strange problem. When I go with the mouse cursor over the item when is in edit mode the application crash. The error seem connected to some unallocated bitmap memory inside the qt code. I'm developing under Windows 7 64bit.

Someone know what I'm doing wrong? :confused:

franz
9th December 2010, 13:53
Why not just set the QAbstractItemModel::ItemIsEditable flag on the newly created table widget item?