Results 1 to 2 of 2

Thread: Unable to modify QSqlRecord in QSqlRelationalTableModel

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    10

    Default Unable to modify QSqlRecord in QSqlRelationalTableModel

    Hello,

    I am trying to modify a QSqlRecord in a QSqlRelationalTableModel but it does not work.

    If I do so and read the data after, I still obtain the old value.

    Qt Code:
    1. model->record(i_model).setValue("param1", QVariant("TEST"));
    2. cout << model->record(i_model).value("param1").toString().toStdString() << "\n"
    To copy to clipboard, switch view to plain text mode 

    If I try the example above, the second line displays the previous value instead of "TEST".

    Thank you.

  2. #2
    Join Date
    Feb 2010
    Posts
    17
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Unable to modify QSqlRecord in QSqlRelationalTableModel

    Hi, did you find a solution to this problem?

    I have pretty much the same issue right now. I can't modify / set a value for a column that has a relation attached to it. If I remove the relation from the model, it works fine.

    My thread is here: http://www.qtcentre.org/threads/2917...-has-relations

Similar Threads

  1. QSqlRecord problem
    By Nefastious in forum Newbie
    Replies: 1
    Last Post: 15th October 2009, 17:30
  2. QSqlRelationalTableModel settable unable to find
    By nietzsche in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2009, 22:51
  3. Using qsqlrecord?
    By triperzonak in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2008, 11:04
  4. QSqlRecord becoming invalid
    By mikro in forum Newbie
    Replies: 5
    Last Post: 3rd October 2006, 18:00
  5. 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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.