[Qt-interest] QTableView and QTreeView item background

Luis Lezcano Airaldi luislezcair at gmail.com
Tue Apr 20 06:32:28 CEST 2010


2010/4/19 Carsten Breuer <CarstenBreuerQt at textwork.de>:
> Hi Andrei,
>
>> I am playing around with a QTableView and QTreeView, each using a
>> QFileSystemModel as model. Working with views is a bit different than what
>> appears to be a straight road with QTableWidget, at least when it comes to
>> coloring the background of just some items displayed.
>
> I see tho possibilities here:
>
> 1.) Write an Delegate and change the color there.
> 2.) Not sure: Use a proxy model.
>
>> Also I am curious if it is possible to add a widget or picture inside a view
>> item?
>
> Check out the model help.
> I'm not user with this one.
> Check also Qt::DecorativeRole (or something like that.

The DecorativeRole is for item's icons, and I think you have to
implement it if you want to use it.

Regards



More information about the Qt-interest-old mailing list