How to display sqlite data as table view?
-
wrote on 10 Dec 2018, 08:50 last edited by Binary Soft 12 Oct 2018, 09:21
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.
-
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.
-
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.
wrote on 10 Dec 2018, 11:39 last edited by@dheerendra said in How to display sqlite data as table view?:
QSqlTableModel
Thanks for your suggestion.
-
Hi
For delegate, please see this
http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.htmlfor 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. -
Hi
For delegate, please see this
http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.htmlfor 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.wrote on 10 Dec 2018, 15:05 last edited by@mrjj
Thanks.
1/5