PDA

View Full Version : Model Views and QLabel



naresh
20th February 2006, 15:43
Hello! I need to do thing like this:

I have a model view, one column with icon. I need this column to display two labels in it. One label is editable by delegate (line edit), and other one is under it displaying some text. Also i need to be able to hide non-editable label (it depends on user preferences). Any ideas how to do this?

wysota
20th February 2006, 16:14
Two possibilities -- change the model (the data() member), but this is a bit stupid or create a custom delegate which will show both the DisplayRole (which will also be the EditRole) and some other role (define a custom one or reuse one of the default ones). You'll have to reimplement the painting routine of course.