PDA

View Full Version : some doubts qtablewidget



mmm286
2nd August 2009, 10:46
Hi,


I would like to know how could I assign the value of a cell in my tablewidget to a variable to then use it for a qprocess. I've created a signal when the the cell is clicked but I don't know how I can do this.
Other question, How could I do that the cells of my tablewidget are locks and nothing can edit them.

Many thanks and sorry for my english!!

john_god
2nd August 2009, 20:36
To get the text of your cell do :


QString str;
str=m_ui->tableWidget->item(row,column)->text();

to prevent the cell form being editable use the function

QTableWidgetItem::setFlags ( Qt::ItemFlags flags )
and the flag
Qt::ItemIsEditable