[Qt-interest] QTableView and delegate

Esben Mose Hansen kde at mosehansen.dk
Fri Nov 6 19:06:22 CET 2009


On Thursday 05 November 2009 20:59:42 Wolfgang Pausch wrote:
> What do you think, is the latter really the right design, or is there some
> simpler solution I missed so far?
> 

Why not simply have the model return the human readable string when data() is 
called with role = Qt::DisplayRole and the integer when call with Qt.:EditRole 
or even some UserRole? That's what I usually do. 

Of course, this does not apply if you want another widget for displaying the 
content.

-- 
Kind regards, Esben



More information about the Qt-interest-old mailing list