PDA

View Full Version : QTableView, how to insert rows "from the bottom to the top"



lotek
17th November 2011, 11:46
Hello,

How to achieve the permanent effect of the scrolling to the bottom whereas the items are inserted to the view? ( the last inserted record shall be at the bottom and visible)
I don't think, that the calling of the scrollTo( ... ) after each inserted record is the correct solution.

THX for your hints

Santosh Reddy
17th November 2011, 12:23
Why not, I don't see any problem using it.

lotek
17th November 2011, 16:48
Hello,

1) I'd like that the first (and then the newest) displayed row occurs at the bottom of the table. Using scrollToBottom() works when the view is field with lines.
2) The records are inserted to the model, the view shall react only, if it is possible wouldn't like to control the view

I thought there is a kind of "reversed" mode, that works as described above.

Thanks

ChrisW67
17th November 2011, 22:47
This:
How to achieve the permanent effect of the scrolling to the bottom whereas the items are inserted to the view? ( the last inserted record shall be at the bottom and visible)
and this:

1) I'd like that the first (and then the newest) displayed row occurs at the bottom of the table.
are not talking about the same thing. The first asks that new rows go on the bottom of the list in the view: this is trivial and scrollTo() is one way to make sure the last row is visible. The second asks that, when the model has fewer rows than the view can display then the view should put the rows at the bottom of its viewport and leave the top portion blank (or something). I am not aware of anything out-of-the-box that achieves the second aim and really cannot see the point of the exercise.

lotek
18th November 2011, 18:48
Thanks for your answer.

to your comment

and really cannot see the point of the exercise.
Imagine following use case:
The lower table view contains records e.g. commands to be executed, the upper table view shows the status of executed commands. The command being sent (the first the lower table view) is removed from the lower table view, and appears in the upper table view. Hence the both table views are tight one by one it shall look like "shifting" of the record from lower to upper area.

bye