[Qt-interest] Move dinamically a qtablewidget

Robert Wood robert.wood at apostrophe.co.uk
Fri Mar 5 13:02:29 CET 2010


On 05/03/10 11:48, mierdatutis mi wrote:
 > Hi,
 >
 > I have a short qtablewidget (3 cols, 2 rows) with many cells.
 > In my program I find a particular cell ( for example the cell is in the
 > 182 row). I would like to know if is possible that the qtablewidget
 > moves automatically to this cell, in other words, I would like that the
 > qtablewidget scroll down to can see this cell.
 >
 > Is that possible?


If I understand what you mean correctly, it's just a case of using 
setCurrentCell().

I am not quite sure what you mean when you say your table has two rows 
and thee columns, yet you then say you want to go to the 182nd row, :~)

Anyhow, if you know you want to scroll to the 182nd row, use

ui->tableName->setCurrentCell(182,columnNumber);

I've just tried that kind of thing on one of my QTableWidgets and it's 
worked fine. Sorry if I've misunderstood.

Cheers,

Rob






More information about the Qt-interest-old mailing list