Results 1 to 6 of 6

Thread: Sqlite & QSqlDatabase problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Sqlite & QSqlDatabase problem

    I'd even say that creating an object of this class on heap is an error. This is an explicitly shared class that should be assigned to an object allocated on stack. The database handler needs to be created using a static call to addDatabase() and thus calling db->addDatabase() is an error as well. The correct call is:
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase(...);
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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


  3. #2
    rsimone Guest

    Default Re: Sqlite & QSqlDatabase problem

    thank you very much

Similar Threads

  1. Very strange socket programming problem
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2008, 12:05
  2. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  3. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  4. SQLite Woes
    By morraine in forum Newbie
    Replies: 5
    Last Post: 12th August 2008, 19:27
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.