[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: Messy toolbar build-up in KOffice
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-05-16 19:56:27
[Download RAW message or body]

On Tue, 16 May 2000, Waldo Bastian wrote:
> 1) Maybe
>
> Well.. that might contribute to the flicker but that was not what I ment.
>
> What happens if you call toolbar->show() is that first the toolbar is shown
> and _AFTER THAT_ KTMainWindow will update the layout and move the toolbar
> to the correct position.
>
> What you would want is that just before the toolbar is shown, the layout
> gets updated so that when the toolbar actually gets shown, it is already on
> the right position. ("doing it right the first time")
>
> But this is all theory. I have no idea whether showing and then moving is
> indeed inefficient or whether Qt handles this somehow.
>
> I do have a patch which solves this problem somewhat (But I don't know yet
> whether this is a real problem)

Ok.. here is the patch. 

It contains some fprintfs to show what is going on.

It does the following:
 1) It overrides KToolbar::show(). If KTMainWindow has updates disabled, it
     delayes actually showing the widget.

 2) In KTMainWindow::updateRects() it makes sure to call KToolBar::show(),
    if the toolbar was already shown, this does nothing. However, if showing
    of the toolbar was delayed by 1) it will now make sure that the toolbar
    gets shown.

If makes the following sequence more efficient:

mainwindow->setUpdatesEnabled(false);
..insert loads of toolbars here...
mainwindow->setUpdatesEnabled(true);
mainwindow->updateRects();

Can someone with toolbar experience have a look at this?

Cheers,
Waldo

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic