Results 1 to 1 of 1

Thread: QSqlTableModel subclassing and query synchornization

  1. #1
    Join Date
    Nov 2011
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QSqlTableModel subclassing and query synchornization

    Hi, what's the best way to implement SELECT FOR UPDATE, because it's not supported in QSqlTable model.
    I'm using PostgreSQL 9, Qt 4.7.4 - MinGW.


    Update:
    Now that I gave it some thought, I think I have an easy solution:

    1. Use a QSqlQuery to exec "SELECT FOR UPDATE..."
    2. Check if result is ok and perform UPDATE, else try again or fail (or handle the situation in some way)
    3. Get the result of the query and set it to the model via setData(...).
    Last edited by Itzuke; 22nd December 2011 at 16:07.

Similar Threads

  1. Replies: 8
    Last Post: 30th March 2011, 21:06
  2. Question on subclassing QSqlTableModel
    By Doug Broadwell in forum Qt Programming
    Replies: 4
    Last Post: 13th February 2010, 01:12
  3. Subclassing QSqlTableModel to overwrite setQuery
    By montuno in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2007, 11:32
  4. QSqlTableModel submitAll access query
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 27th April 2007, 09:04
  5. Subclassing
    By joseph in forum Newbie
    Replies: 1
    Last Post: 25th February 2006, 15:06

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.