Results 1 to 3 of 3

Thread: Can you retrieve QSqlQuery.LastError after QSqlQuery.Finish?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can you retrieve QSqlQuery.LastError after QSqlQuery.Finish?

    You could spend five minutes writing a quick test or reading the Qt source code to see that it does. Alternatively, you could just assume that it does not and cache lastError() before you do.
    Qt Code:
    1. void QSqlQuery::finish()
    2. {
    3. if (isActive()) {
    4. d->sqlResult->setLastError(QSqlError());
    5. ...
    To copy to clipboard, switch view to plain text mode 

    The docs are quite clear that you probably do not need to be calling finish() anyway.

  2. The following user says thank you to ChrisW67 for this useful post:

    m3rlin (9th April 2013)

Similar Threads

  1. QSqlQuery
    By rajko in forum Newbie
    Replies: 7
    Last Post: 24th May 2012, 21:26
  2. Replies: 1
    Last Post: 18th July 2011, 12:12
  3. Using QSqlQuery
    By darkman_dev in forum Newbie
    Replies: 2
    Last Post: 4th February 2011, 21:40
  4. Replies: 3
    Last Post: 25th August 2009, 13:03
  5. Qt 4.5.1 / MySQL 5.1, QSqlQuery::lastError() 1295
    By wdezell in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2009, 15:36

Tags for this Thread

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.