Results 1 to 4 of 4

Thread: QSqlTableModel programmatic changes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlTableModel programmatic changes

    try putting
    Qt Code:
    1. timestamp DATE DEFAULT (datetime('now','localtime')),
    To copy to clipboard, switch view to plain text mode 

    in your sqlite schema
    Got to keep the loonies on the path ...

  2. #2
    Join Date
    Jul 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QSqlTableModel programmatic changes

    Thanks. In the end I wrote a trigger into the schema that operated as soon as a line was added.
    But still I wonder why my first approach didn't work. You can't change a value in a table model before you submit it? Or am I just going about it the wrong way? Do I have to abstract a record model first, or something, rather than accessing tablemodel.record().setvalue ?

    John
    Learning, one problem at a time.

Similar Threads

  1. QSqlTableModel
    By codeman in forum Qt Programming
    Replies: 7
    Last Post: 4th May 2009, 11:04
  2. QSqlTableModel and LIKE
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2008, 08:45
  3. QSqlTableModel Help pls
    By munna in forum Newbie
    Replies: 1
    Last Post: 7th March 2006, 19:40
  4. QSqlTableModel
    By raphaelf in forum Qt Programming
    Replies: 4
    Last Post: 4th March 2006, 12:35
  5. QSqlTableModel Help pls
    By munna in forum Newbie
    Replies: 1
    Last Post: 26th January 2006, 07:58

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.