Reading Value from a QTablewidget
Unsolved
General and Desktop
-
I have a Qtable widget where I want to extract the value in one of the cells, and then make a series of calculations. I will then enter the result of that calculation in another cell.
I cannot seem to find any way to extract a value from the table.
I use thefollowing:
QTableWidgetItem *madeItem = ui->tableWidget->item(0,4);
The program then stops at this point in qtablewidget.h.
inline QString text() const { return data(Qt::DisplayRole).toString(); } inline void setText(const QString &text);
What am I missing?
-
@bliss said in Reading Value from a QTablewidget:
Hi and welcome
madeItem
and its not NULL ?
And everything is setup correctly ? with row,col count ?
https://wiki.qt.io/How_to_Use_QTableWidgetIf you reference invalid cell ( empty as no item assigned) that would result in something like that.