The first argument of the item() method is the row.
Get the item for each cell you are interested in and read its data.
Cheers,
_
The first argument of the item() method is the row.
Get the item for each cell you are interested in and read its data.
Cheers,
_
Thanks Anda_Skoa for your reply.
I am using a loop to accees the cells of my column.
I have added the following condition in my loop:
Qt Code:
QTableWidgetItem *valueOfMycell; if(valueOfMyCell->isSelected()) { }To copy to clipboard, switch view to plain text mode
The output (from qDebug) ist excatly the values I am looking for, but the program crasches down.
When I removed the line 2, I have all values of my culumn, including those deselected.
I now know that the condition of the line 2 is not appropriate, but I am wondering if there is another condition which matches with this case.
I would appreciate any help.
Many thanks in advance.
The condition looks good, it is more likely that you have an error elsewhere, especially if "the program crashes down" means it unexpectedly terminates.
Alternatively look at QTableWidget::selectedItems() to directly get the selected cells.
Cheers,
_
Many thanks Anda_Skoa for your help.
I have successfully fixed the problem using QTableWidget::selectedItems() as you have specified.
For me is this problem solved.
Many thanks one more time.
Bookmarks