Results 1 to 2 of 2

Thread: Navigate through QTableView with next, previos, first and last buttons

  1. #1
    Join Date
    Apr 2008
    Posts
    17
    Thanks
    4

    Default Navigate through QTableView with next, previos, first and last buttons

    Hi,

    I have next problem to solve, and I'm not sure how to do that using the model/view arquitecture of qt.

    I have a main form, with a QTableView, the view of a QSqlQueryModel. So, I have a list of records (in the QTableView) of a table of a database. The user can select one row, push an edit button, an another form, editForm, is open with the data of the row (and the record too) for the user to edit.

    I want to implement several buttons on the editForm: First, Previous, Next and Last. A navigate set of buttons. When the user click first, the form would show the first record (or row) of the QTableView. If the user click previous, the form would show the previous record of the actual row... An so on...

    I don't see how to do that using model/view arquitecture in qt. How would you do that?

    Thanks a lot.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Navigate through QTableView with next, previos, first and last buttons

    See QAbstractItemView::moveCursor()
    • QAbstractItemView::MoveNext
    • QAbstractItemView::MovePrevious
    • QAbstractItemView::MoveHome
    • QAbstractItemView::MoveEnd
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Sparhawk (19th May 2008)

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.