[Qt-interest] get and set current item in QTableView

Andreas Pakulat apaku at gmx.de
Wed May 20 16:13:57 CEST 2009


On 20.05.09 10:56:30, Matthias Pospiech wrote:
> I can get the current row and column via the index
> 
>     QModelIndex index = tableViewPowerDegree->currentIndex();
>     tableViewPowerDegree->selectRow(index.row() + 1);
>     tableViewPowerDegree->selectColumn(1);
> 
> However I cannot modify the index and setting the row and column one 
> after the other
> as above, because that really selects the comlete row and column, but 
> not the item at (row, column)

You're not making much sense here (at least to me), can you elaborate what
exactly you want to happen? If you want to select multiple items in your
table then you should use the selectionModel() of the view as
selectRow/Column are merely convenience methods provided for easier
selection of whole rows/columns.

Andreas

-- 
Stay away from flying saucers today.



More information about the Qt-interest-old mailing list