QLabel in layout

Mark Summerfield mark at qtrac.eu
Mon Jun 16 12:39:31 BST 2008


On 2008-06-16, John Tapsell wrote:
> Hey all,
>
>   I have a QLabel in a vertical layout in my window along with a
> custom plotting widget.  The text in the QLabel is updated twice a
> second or so.
>
>   The problem is that changing the text in the QLabel means that its
> size is invalidated, which in turn invalidates the whole layout, which
> in turn means that everything in the layout is repainted, including my
> custom plotting widget.  This means that a full repaint is continually
> requested in my custom plotting widget which is quite an expensive
> operation.
>
>   Is there any way around this?  The changing of size on the qlabel
> shouldn't affect items above it in a vertical layout, but it does
> anyway.

You could try making the label's minimum size as big as you think it
will ever need. Or, more crudely, setting it to a fixed size.

-- 
Mark Summerfield, Qtrac Ltd., www.qtrac.eu





More information about the kde-core-devel mailing list