PDA

View Full Version : Line Decoration in QListView



fruzzo
12th September 2011, 11:32
Hi,
I want to insert at the beginning of a row of my QListView a little styled line as decoartion instead of the classic colored icon...is there a simple trick to complete this task or I've to use QItemDelegate approch?

wysota
12th September 2011, 11:38
You can either provide a custom delegate or make your styled line an icon and set it as decoration so that the default delegate can render it.

fruzzo
15th September 2011, 14:56
You can either provide a custom delegate or make your styled line an icon and set it as decoration so that the default delegate can render it.
The line style is editable by the user so it's impossible to create an icon for each line color/width/style combination...I think its better to create dynamically a decoration instead the standard icon decoration inserted through Qt::DecorationRole, or an item representing the style line...both using a custom delegate.