Results 1 to 20 of 34

Thread: EditStrategy, how to save data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    16
    Thanked 2 Times in 1 Post

    Default EditStrategy, how to save data

    I'm beginning very slowly to catch some grip. Sometimes I even code more than search for things.

    I can't seem to save changes in a QSqlTableModel, not if I set it to OnFieldChange and not if I set it to OnManualSubmit.
    What am I overlooking?
    Thanks

    code:

    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    2. db.setHostName("192.168.1.10");
    3. db.setDatabaseName("iris");
    4. db.setUserName("jean");
    5. db.setPassword("");
    6. if (!db.open())
    7. setWindowTitle(db.lastError().text());
    8.  
    9. model = new QSqlTableModel;
    10. model->setTable("pix");
    11. model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    12. model->select();
    13. table->setModel(model);
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 5th January 2008 at 23:57. Reason: missing [code] tags

Similar Threads

  1. QSqlQueryModel data update
    By psi in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2012, 04:59
  2. Replies: 4
    Last Post: 19th October 2007, 20:47
  3. Data model
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2007, 13:14
  4. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 13:53
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.