PDA

View Full Version : QTableWidget update problem



mammenj
13th August 2010, 04:34
I am having trouble updating cells in QTableWidget...below is the snippet




//fileds are qstringlist and they are not null//
QTableWidgetItem *myitem = new QTableWidgetItem(fields[i]);

//qDebug() << "my item " << myitem->text();

// resultTable is the QTableWidget from UI form
ui->resultTable->setItem(row, i, myitem);



The above code is in a loop to update the table. I am not sure where I am going wrong or is it a bug?
I am on Windows Vista with Qt SDK v2010.04(Open source)
Any help would be appreciated.
BTW this a sample program (Trip planner from Networking section) from C++ GUI Programming with QT 4 2nd edition

franz
13th August 2010, 06:23
* No it is not a bug.
* What are you trying to achieve and what do you see?
* I would have already switched to writing a custom model and ditch the QTableWidget. It provides you with more issues than you are trying to solve. QAbstractTableModel gives you a very decent starting point.

Lykurg
13th August 2010, 06:46
...and [QTCLASS] != [CODE].