getting data from tablewidget
-
wrote on 24 Jun 2021, 08:55 last edited by
Hi All,
Still new and learning so hope someone can help.
I have a QTablewidget which I have filled with data. When I double click on a row in the tablewidget I would like to get particular data for example the data in cell (1) and cell(5).
how can i Do this .
thank you -
Hi All,
Still new and learning so hope someone can help.
I have a QTablewidget which I have filled with data. When I double click on a row in the tablewidget I would like to get particular data for example the data in cell (1) and cell(5).
how can i Do this .
thank youwrote on 24 Jun 2021, 08:56 last edited by@dziko147
This was just answered in https://forum.qt.io/topic/127899/how-to-get-value-of-cell-in-qtablewidget-on-double-clicking/2. -
@JonB
I posted a new Topic :) .
So it's not the same operation .What i need is when i clicked on row , i get some particular data . Not those which i clicked on .
I hope that my question was clear . -
wrote on 24 Jun 2021, 09:14 last edited by VRonin
QObject::connect(tableWidget,&QTableWidget::cellDoubleClicked,[=](int row, int column){ QTableWidgetItem *cell1 = tableWidget->item(row,1); QTableWidgetItem *cell5 = tableWidget->item(row,5); QVariant myData1 = cell1->data(Qt::DisplayRole); QVariant myData5 = cell5->data(Qt::DisplayRole); qDebug() << myData1 << myData5; });
3/6