Qt-interest Archive, December 2006
delegates
Message 1 in thread
I have create a delegate for a list view. The user can modify the look
of the items using other contorls or keyboard shortcuts, which
requires repainting the entire list view, aka all items. I can easily
instruct the delegate object of the new painting params but how do I
instruct the view to repaint? the size of the items will not resize,
but all items must be repainted immeidately. calling repaint() on the
list view widget has no effect, nor do calls to update().
Will
--
[ signature omitted ]
Message 2 in thread
On 19.12.06 13:47:29, Will Stokes wrote:
> I have create a delegate for a list view. The user can modify the look
> of the items using other contorls or keyboard shortcuts, which
> requires repainting the entire list view, aka all items. I can easily
> instruct the delegate object of the new painting params but how do I
> instruct the view to repaint? the size of the items will not resize,
> but all items must be repainted immeidately. calling repaint() on the
> list view widget has no effect, nor do calls to update().
Call it on the list view's viewPort() (hint QListView is a indirect
subclass of QScrollArea).
Andreas
--
[ signature omitted ]
Message 3 in thread
Will Stokes schrieb:
> but how do I instruct the view to repaint?
Two things come to mind you could try:
- Slot reset() in the view.
- Signal dataChanged() from your model. OK, it isn't exactly thought for
being used like that...
Yet they may be too expensive to use.
Martin
--
[ signature omitted ]