[Qt-interest] Modifying data representation in model/view

jarkko.marjeta at tietosaab.com jarkko.marjeta at tietosaab.com
Fri Sep 4 12:49:44 CEST 2009


Hi,

I am starting to study the model/view concepts of Qt. 

I am using Qt 4.5.2 and I have trouble in trying to find out, how to change data "representation" when populating a view from model. I have a QSqlTableModel to hold the database data and a QTableView that is displaying the contents of the database. Now some of the data in the database is in a different format than what I would like to show in the View. For example I would like to show date formats differently (UTC/Localtime), but I don't know where/how to implement such logic. I dont want the model to be affected in any way, only the data shown in the view.

Could you please give me some pointers or point out an example about this. I looked at some the examples provided with Qt, but I did not notice this kind of change-of-representation-format.

Thank you for your advice.

BR,
  Jarkko

 



More information about the Qt-interest-old mailing list