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.
  • B Offline
    B Offline
    Binary Soft
    wrote on 10 Dec 2018, 08:50 last edited by Binary Soft 12 Oct 2018, 09:21
    #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
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 10 Dec 2018, 09:49 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

      B 1 Reply Last reply 10 Dec 2018, 11:39
      1
      • D dheerendra
        10 Dec 2018, 09:49

        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.

        B Offline
        B Offline
        Binary Soft
        wrote on 10 Dec 2018, 11:39 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
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 10 Dec 2018, 11:52 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.

          B 1 Reply Last reply 10 Dec 2018, 15:05
          0
          • M mrjj
            10 Dec 2018, 11:52

            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.

            B Offline
            B Offline
            Binary Soft
            wrote on 10 Dec 2018, 15:05 last edited by
            #5

            @mrjj
            Thanks.

            1 Reply Last reply
            0

            1/5

            10 Dec 2018, 08:50

            • Login

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