Results 1 to 3 of 3

Thread: Index (position) changed on saving with QTableView

Hybrid View

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

    Default Re: Index (position) changed on saving with QTableView

    How do you change that data? Do you call select() somewhere?
    J-P Nurmi

  2. #2
    Join Date
    Jul 2008
    Location
    Spain
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: Index (position) changed on saving with QTableView

    When using
    Qt Code:
    1. my_model.setEditStrategy(QSqlTableModel::OnManualSubmit);
    To copy to clipboard, switch view to plain text mode 
    I save with
    Qt Code:
    1. my_model.submitAll();
    To copy to clipboard, switch view to plain text mode 

    When using
    Qt Code:
    1. my_model.setEditStrategy(QSqlTableModel::OnRowChange);
    To copy to clipboard, switch view to plain text mode 
    I don't save manually.

    After saving, occurs a "reselect" and the table position goes to the beginning.

    The position must go to next field when ending an edition with tab key. And when clicking on another position while we are in edit mode must go to that position, not to the beginning.

    Thank you
    Auryn
    Starting to learn the world of Qt

Tags for this Thread

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.