[Qt-interest] Query related selection color in Qt

Andre Somers andre at familiesomers.nl
Thu Jun 24 10:00:20 CEST 2010


On 24-6-2010 8:47, Ramesh wrote:
> One question I feel to ask now, i didn’t understand why are you using the
> style sheet delegate class. Instead you can set the style sheet directly to
> listview by specifying what suppose to be taken place when the item is
> highlighted...
>    
You know what? That is a very good question! It turns out you already 
can do more with style sheets on item views than I thought possible. 
Thanks for pointing that out.

However, I think there is still a use case for the delegate, as it 
provides functionality the standard item can not (please correct me if 
I'm wrong!):
* you can make styles apply depending on things like column and row numbers
* you can make styles apply depending on data roles and flags
* more supported properties (like text alignment)
* full rich text support

Still, for things like your usecase, it turns out you don't need it, and 
you could just have applied a style sheet to your view and be done. Much 
simpler. A slight dissapointment for me (invested time in something that 
turns out is not as useful as I hoped it would be), but good news for 
every body else!

André

-- 
Nokia Certified Qt Developer.
Interested in Qt related job offers or freelance Qt consulting work.




More information about the Qt-interest-old mailing list