Results 1 to 5 of 5

Thread: QTableView, how to insert rows "from the bottom to the top"

  1. #1
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableView, how to insert rows "from the bottom to the top"

    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

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QTableView, how to insert rows "from the bottom to the top"

    Why not, I don't see any problem using it.

  3. #3
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView, how to insert rows "from the bottom to the top"

    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

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTableView, how to insert rows "from the bottom to the top"

    This:
    Quote Originally Posted by lotek View Post
    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.

  5. #5
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView, how to insert rows "from the bottom to the top"

    Thanks for your answer.

    to your comment
    Quote Originally Posted by ChrisW67 View Post
    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

Similar Threads

  1. Replies: 10
    Last Post: 17th July 2014, 10:52
  2. Replies: 2
    Last Post: 21st August 2011, 07:57
  3. Replies: 1
    Last Post: 7th April 2010, 21:46
  4. Replies: 3
    Last Post: 25th August 2009, 13:03
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.