Results 1 to 4 of 4

Thread: how to show my sqlite database table on mainwindow with tableview widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to show my sqlite database table on mainwindow with tableview widget

    Quote Originally Posted by prasad1001 View Post
    And now i want to display the table in my mainwindow tableview....
    Everything is ok but table is not displaying on the window...and no errors are comming...but when i clicked the submit button i got the error as shown in fig.
    Your QSqlTableModel does not have a database connection to work with, see second constructor argument.
    Also the given table name is wrong (your table is not called "library data", just "library").

    Cheers,
    _

    P.S.: A Sqlite database is a single file, you don't need username or password for that.

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

    prasad1001 (26th February 2014)

Similar Threads

  1. show object (scene) in widget in class class mainwindow
    By rimie23 in forum Qt Programming
    Replies: 8
    Last Post: 1st May 2012, 16:15
  2. QStandardItemModel to sqlite database table
    By sattu in forum Qt Programming
    Replies: 19
    Last Post: 10th March 2011, 23:01
  3. Replies: 3
    Last Post: 12th July 2010, 13:12
  4. Replies: 10
    Last Post: 29th May 2010, 18:42
  5. Replies: 4
    Last Post: 4th February 2008, 06:16

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.