Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, October 2006
Re: QTableView displaying Images [Qt 4.1.4]


Message 1 in thread

On Tuesday 26 September 2006 17:45, Kaiser, Rene wrote:
> Hi everybody,
>
> I'd like to insert images into the cells of a table.
> As default, the images exceed the cell's boarders and cause odd
> repainting behaviour. I need them to stay within the cell (max.
> stretching) and like them to resize automatically once the user changes
> the cell's with/height.
>
> Hints to any useful Qt methods or even code snipplets would make me
> happy.

Subclass the itemdelegate and implement your own painting for the one case 
where there is an image.  Then you can scale the image.

-Benjamin Meyer

--
 [ signature omitted ]