Results 1 to 5 of 5

Thread: QSqlTableModel submitAll access query

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QSqlTableModel submitAll access query

    i have subclass a QTableView to display row limit ... and is model model->setEditStrategy(QSqlTableModel::OnManualSubmit) ;

    How i can access last query to update the 2° database back-up to?



    Qt Code:
    1. /* save all DirtySQL true value and reset DirtySQL to false */
    2. void Mysql_Table::BigCommit()
    3. {
    4. if (model->submitAll()) {
    5. model->database().commit();
    6. DirtySQL = false;
    7. emit ModelError(true);
    8. return;
    9. } else {
    10. model->database().rollback();
    11.  
    12. if (!haveindex) {
    13. QMessageBox::warning(0, tr("Table %1 ").arg(table),
    14. tr("The database reported an error: %1\nAnd table not having index!").arg(model->lastError().text()));
    15. } else {
    16. QMessageBox::warning(0, tr("Table %1 ").arg(table),
    17. tr("The database reported an error: %1").arg(model->lastError().text()));
    18. }
    19. emit ModelError(false);
    20. return;
    21. }
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 26th April 2007 at 23:52. Reason: wrapped too long lines

Similar Threads

  1. Replies: 1
    Last Post: 4th October 2006, 16: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
  •  
Qt is a trademark of The Qt Company.