PDA

View Full Version : Change value inside QTableView or QSqlQuery



jano_alex_es
15th May 2009, 10:39
Hi,

one of the fields of my database return an integer, but I'd like to display the info as a String (for instance, if the integer is 0 then I'd like to show "Novice", if it's 10 then "Expert" and so on).

There is any way to edit the data inside a QTableView or a DataSet?

thanks!

spirit
15th May 2009, 10:49
try to write your own item delegate, which will recognize numbers and set in a model using Qt:: DisplayRole needed strings.