How to throw cell click event of QTable Widget
-
Hi, I I did something similar with QTableWidget and I used cell clicked signal
(http://doc.qt.nokia.com/latest/qtablewidget.html)
@void cellClicked ( int row, int column )@if I understand you correctly you want to trigger the signal for the a particular cell (in the first post you said row, it may have confused some) if you have connected the signal and slot, you should be able to call the slot with row 1 and column 1.
I have something like this
@void VenVisReservaciones::on_tblReservaciones_cellClicked(int row, int column){
..
}@So if I finish processing data I do something like this
@
on_tblReservaciones_cellClicked(1,1);
@If you want to click a cell and then you want to read the first cell of that row, then you can do something like this:
@void VenVisReservaciones::on_tblReservaciones_cellClicked(int row, int column){
process(ui->tblReservaciones->item(1,row)->text());
..
}process(QString text){
..
}
@Hope it helps you!
-
Hi Gerolf
Its not working,I m doing something like this
@
on_AE_Tablecell_Clicked(0,0);//This is the slot i want to be called
ui.tableWidget_AE->setCurrentCell(0,0,QItemSelectionModel::Rows);
@
By doing this it only setting the focus to (0,0) item but i want to show that complete row as blue and other previous selection should be removed. -
selectRow(0) is the slot to use.
You could have found yourself very easily if you had scanned through the fine API documentation of [[Doc:QTableWidget]] and its base classes [[Doc:QTableView]] and [[Doc:QAbstractItemView]]. Finding that slot with a quick search in the browser is a no brainer.