How to read null value from QTableWidget?
-
if item at cell is null - then at cell - is nothing ;)
-
@
QTableWidgetItem *item = tableWidget->item(5, 7);
if(item) {
// the item exists
// do something with it
// it is safe to call
QString t = item->text();
} else {
// the item does NOT exist
// you have a NULL pointer here
// NEVER call item->xxx here, the program will crash
// you may call this a NULL item
// if you want to do something here, create an item
// and put it into the table widget
}
@