Results 1 to 10 of 10

Thread: QSql - "Error opening database", "unable to open database file"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QSql - "Error opening database", "unable to open database file"

    "model" goes out of scope at the end of the constructor leaving nothing for the table view to show.

  2. #2
    Join Date
    May 2010
    Location
    Rzeszow/Poland
    Posts
    17
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSql - "Error opening database", "unable to open database file"

    @JD2000 - I use Qt Creator.

    Quote Originally Posted by ChrisW67 View Post
    "model" goes out of scope at the end of the constructor leaving nothing for the table view to show.
    What is the solution?

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

    Default Re: QSql - "Error opening database", "unable to open database file"

    Add this to mainwidow.h
    Qt Code:
    1. private:
    To copy to clipboard, switch view to plain text mode 
    Got to keep the loonies on the path ...

  4. The following user says thank you to JD2000 for this useful post:

    SykeS (20th May 2010)

Similar Threads

  1. Replies: 3
    Last Post: 15th February 2010, 17:27
  2. Replies: 3
    Last Post: 8th July 2008, 19:37
  3. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 11:45
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.