Wing_Zero
16th August 2010, 14:05
Hi at all,
I'm trying to simply set a QString in a QTableWidgetItem.
ui->tableWidget->item(0,0)->setData(Qt::DisplayRoleRole,"foo");
But when I do this the little app crashes.
Instead, if I write something before in the same cell by myself, the setData works out.
It sounds like the item object isn't still created when I try to setData. When I before write something in the same cell trought the GUI, the object is created and the the setData istruction works.
Any Idea? that's real strange.
Sorry for my english :(
Gianluigi
I'm trying to simply set a QString in a QTableWidgetItem.
ui->tableWidget->item(0,0)->setData(Qt::DisplayRoleRole,"foo");
But when I do this the little app crashes.
Instead, if I write something before in the same cell by myself, the setData works out.
It sounds like the item object isn't still created when I try to setData. When I before write something in the same cell trought the GUI, the object is created and the the setData istruction works.
Any Idea? that's real strange.
Sorry for my english :(
Gianluigi