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. How to display sqlite data as table view?
Forum Updated to NodeBB v4.3 + New Features

How to display sqlite data as table view?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.7k Views 1 Watching
  • 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.
  • Binary SoftB Offline
    Binary SoftB Offline
    Binary Soft
    wrote on last edited by Binary Soft
    #1

    Hello,
    I've a sqlite db with movie data. Movie table has these field names:
    ID, Cover, Name, Quality, Year. All movie picture are inserted Cover Field as BLOB.
    I want to show movie cover picture with Name, Quality, Year in each cell of the table. (eg. Table with 7 Column Pictures and many rows from db.) Please see the picture below. Which model view is suitable for this view. QTableView? or Others. Any reference or examples?

    When I do my customized QLabel with QScrollArea, data loading time is too slow for large records. So I want to use it as model view.

    Thanks.

    0_1544431933375_Untitled.png

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Did you get a chance to look at QSqlTableModel ? This will help you. Also look at how to write the custom delegates. So combination of QTableVeiw, custom delegates and QSqlTableModel will help you to make your concept.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      Binary SoftB 1 Reply Last reply
      1
      • dheerendraD dheerendra

        Did you get a chance to look at QSqlTableModel ? This will help you. Also look at how to write the custom delegates. So combination of QTableVeiw, custom delegates and QSqlTableModel will help you to make your concept.

        Binary SoftB Offline
        Binary SoftB Offline
        Binary Soft
        wrote on last edited by
        #3

        @dheerendra said in How to display sqlite data as table view?:

        QSqlTableModel

        Thanks for your suggestion.

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

          Hi
          For delegate, please see this
          http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.html

          for your case, you could display the image and draw text also.
          Here it paints stars but the concept is the same.

          Also for ListView, check out the iconMode
          http://doc.qt.io/qt-5/qlistview.html#viewMode-prop
          it will layout the list like the your image.

          Binary SoftB 1 Reply Last reply
          0
          • mrjjM mrjj

            Hi
            For delegate, please see this
            http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.html

            for your case, you could display the image and draw text also.
            Here it paints stars but the concept is the same.

            Also for ListView, check out the iconMode
            http://doc.qt.io/qt-5/qlistview.html#viewMode-prop
            it will layout the list like the your image.

            Binary SoftB Offline
            Binary SoftB Offline
            Binary Soft
            wrote on last edited by
            #5

            @mrjj
            Thanks.

            1 Reply Last reply
            0

            • Login

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