Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Use QTableWidget in c++ visual studio to display sqlite database contents
QtWS25 Last Chance

Use QTableWidget in c++ visual studio to display sqlite database contents

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 928 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ruboo
    wrote on last edited by
    #1

    Hello every one, I am new here and to Qt.
    I need to use qt in visual studio, i have added Qtaddon in VS, but it only creates ui file, I want to access sqlite db and display contents of db in a QTable widget form. I am very confused here.
    If i use Qt creator, how would i link it with my VS project, and in VS how can i access sqlite using qtablewidget or qtableview.
    Any one please get me out of this confusion please.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to the forums.
      You can use the
      http://doc.qt.io/qt-5/qsqltablemodel.html#details
      There is sample in the docs of how to hook up the model to the view.
      There are also other models if showing a table is not what you want.
      The http://doc.qt.io/qt-5/qsqlquerymodel.html
      allows to use SQL to select the data.

      Im not sure what Qtaddon can create regarding UI files.
      QtCreator can both create a stand alone UI and one that has .h and .cpp also.
      I assumed its the same with the addon but i have no VS to test it.
      Does addon offer more than one option for UI file ?

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved