Results 1 to 2 of 2

Thread: Select row in QTableView after insert.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    7
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11 Windows

    Default Select row in QTableView after insert.

    Hello,

    I would like to select a row in the a tableview after inserting it. I'm inserting the row as the last in the model, using QSqlTableModel.insertRow(QSqlTableModel.rowCount() ). I want to select the inserted row in a QTableView which uses this model.
    My problem is I cannot find which row in the table view corresponds to the new row in the model. Or, in other words: given a row in the model, how can I know the row where it's displayed in the table?

    Thanks !
    Last edited by fede; 14th April 2009 at 02:02. Reason: Added text

Similar Threads

  1. QSqlTableModel and QTableView selection problems
    By innerhippy in forum Qt Programming
    Replies: 5
    Last Post: 19th December 2008, 05:48
  2. How to select a cell in a QTableView
    By JeanC in forum Qt Programming
    Replies: 6
    Last Post: 6th February 2008, 13:20
  3. Bulk insert into SQLite
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 19th November 2007, 03:56
  4. Insert QCheckBox into QTableView
    By wind in forum Qt Programming
    Replies: 3
    Last Post: 8th October 2006, 16:15
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49

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
  •  
Qt is a trademark of The Qt Company.