Results 1 to 3 of 3

Thread: Database to display all rows on a table

  1. #1
    Join Date
    Apr 2016
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Database to display all rows on a table

    ref = self.ref_lineEdit.text()

    connection = sqlite3.connect("db.db")
    result = connection.cursor()
    result = connection.execute("SELECT * FROM order WHERE ref = '"+ref+"'")
    data = result.fetchall()
    connection.close()

    I want to get the information from database table to display all rows on a qttable. Can some help me get this information to display on table. like a list

    thank you

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Database to display all rows on a table


  3. #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: Database to display all rows on a table

    Quote Originally Posted by Lesiok View Post
    QTableView but yes.

    Or create a table model derived from QAbstractTableModel and use your SQL API.

    Cheers,
    _

Similar Threads

  1. Replies: 0
    Last Post: 2nd July 2015, 03:47
  2. Replies: 9
    Last Post: 14th February 2013, 13:14
  3. Replies: 0
    Last Post: 18th April 2011, 03:21
  4. Position of rows in table
    By Slewman in forum Qt Programming
    Replies: 10
    Last Post: 18th February 2010, 16:13
  5. Refreshing one or more rows in a table view
    By William Wilson in forum Qt Programming
    Replies: 4
    Last Post: 25th May 2009, 01:10

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.