PDA

View Full Version : Q3ListView highlight part of a column



sreedhar
2nd May 2006, 15:19
hi,
I am using Qt4.1.2. I am using Q3ListView, and i want to highlight a part of the text in an item.

It's the same as find does in QTextEdit (highlight the text that is found).
I want to implement find in Q3ListView, such that it highlights the text in a column i.e highlilght the text written in find dialog.

please post the code if its available.
Thanks in advance,

regards,
sree

wysota
5th May 2006, 10:26
Could you give more details? Why are you using Q3ListView instead of QTreeWidget? Anyway, you should subclass the item class and provide ways to mark, which part of the item is "highlighted" and then in the painting routine do the highlighting either by rendering rich text or simply by dividing the routine into three parts -- render text before highlight, change colour and render the highlighted part, change colour and render the rest.