Results 1 to 4 of 4

Thread: submitALL, QSqlTableModel and QTableView

  1. #1
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default submitALL, QSqlTableModel and QTableView

    Okay all you experts -- just looking for a little explanation...

    I have a QTableView which displays data from a QSqlTableModel...I have up and down arrow keys that allow me to highlight a row and have that row move up and down in list dependent on the arrow clicked, and this works perfectly -- with the view being refreshed -- only after I perform a model->submitAll...Is there any way to get the same results, that is, have the view reflect that I moved row 4 up to row 3, *without* have to submit my data? Again it's working fine now, but I'd like to leave all data submissions in the hands of the user via a "SAVE" button (request from the client)...


    scott

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: submitALL, QSqlTableModel and QTableView

    Set editStrategy of the model to QSqlTableModel::OnManualSubmit
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: submitALL, QSqlTableModel and QTableView

    That's what I have (I changed it to the other two and messed my data up )...That still requires me to submitAll before the QTableView will be refreshed...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: submitALL, QSqlTableModel and QTableView

    In that case I have no idea what you want.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 8th July 2011, 13:28
  2. Maintaining QTableView Selection through submitAll()
    By ChrisW67 in forum Qt Programming
    Replies: 0
    Last Post: 27th July 2009, 01:33
  3. QSqlTableModel->submitAll()
    By maxel in forum Qt Programming
    Replies: 1
    Last Post: 6th September 2008, 09:30
  4. QSqlTableModel submitAll access query
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 27th April 2007, 09:04
  5. QTableView and QSQLTableModel
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2006, 19:09

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.