Results 1 to 2 of 2

Thread: QSqlRecord setValue doesn't set the value

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    29
    Thanks
    8
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QSqlRecord setValue doesn't set the value

    I have a TableView and I create a QSqlQueryModel and then set the the table. All that works well and good.

    From another class, I look at a record of the model based on the index.
    If a certain value is null, then I give it a value like so:

    Qt Code:
    1. // int rowIndex is passed
    2. QString Image_Set_ID = "some value";
    3. QVariant qvImage_Set_ID;
    4. qvImage_Set_ID.setValue(Image_Set_ID);
    5. ((QSqlQueryModel*)(tableView->model()))->record(rowIndex).setValue("Image_Set_ID", qvImage_Set_ID);
    To copy to clipboard, switch view to plain text mode 

    But then if I look at the record from the model of the tableView again, it isn't updated.

    Thanks,
    Sean

    What is missing?
    Last edited by wysota; 7th February 2008 at 20:18. Reason: reformatted to look better

Similar Threads

  1. SetValue
    By phillip_Qt in forum Qt Programming
    Replies: 4
    Last Post: 3rd October 2007, 22:45
  2. QSqlRecord becoming invalid
    By mikro in forum Newbie
    Replies: 5
    Last Post: 3rd October 2006, 18:00
  3. QSqlRecord problem
    By stevey in forum Qt Programming
    Replies: 2
    Last Post: 24th September 2006, 22:32

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.