Solved how to add pictures to a qt widget table in qt
-
@SGaist and is it possible to put pictures inside QDataWidgetMapper ?
-
QDataWidgetMapper does the link between widgets and database fields.
How are you storing images in that database ?
-
@SGaist its a mysql server with a database
i am using c++ connector
and reading a pic image binary and store it inside the database in a longblob or blob var type -
Is the format of the picture fixed ?
-
sorry for late xD 600 second cooldown
@SGaist u mean by fixed is that a single format ? like png or jpg ?
if so no it wwill be just one format
and its controlable by the user*its a desktop app that is controlable by just one user so the format type is not an issue
-
Will you use a QTableView ? If so you can either use a custom QIdentityProxyModel that will create a QPixmap from the blob for the DecorationRole or a custom QStyledItemDelegate to draw the blob.
-
@SGaist you think qtableview is the best way to show the data ? or there is other better way to do it
if not thank you so much
that was very helpful <3 -
It depends on how you want your user to access the data.
-
i want something like this picture :
Student Management System
with some pics on each student -
This looks like a classic web application.
While you can do the front end with Qt, I think you should first rethink your backend architecture to provide all the services needed to manage such an application.
-
thank you so much <3