[Interest] Finished resizing a window?

Jason H scorp1us at yahoo.com
Tue Feb 25 22:37:18 CET 2014


Have you tried  implementing a layout that has a locking mechanism?
In theory you can get the root layout to not layout until you approve the change? This will produce an unfilled area until you unlock it.



________________________________
 From: "william.crocker at analog.com" <william.crocker at analog.com>
To: interest at qt-project.org 
Sent: Tuesday, February 25, 2014 1:08 PM
Subject: Re: [Interest] Finished resizing a window?
 

On 02/25/2014 12:56 PM, Thiago Macieira wrote:
> Em seg 24 fev 2014, às 14:30:29, John Weeks escreveu:
>> On 24-Feb-2014, at 2:24 PM, Thiago Macieira wrote:
>>> That's something entirely controlled by the window manager. Sorry.
>>
>> Thanks, Thiago. That's good to know.
>
> Here's a suggestion: do a delayed repainting after you get a resize event.
>
> If you wait 200 ms before repainting, if the window keeps getting resized, the
> delay keeps resetting. So effectively, you won't repaint until the window
> settles.
>

But if the user pauses for more than 200ms
the expensive redraw will commence and annoy.

Perhaps...

Break the redraw up into a number of parts,
each of which takes a relatively short amount of time.

resize() {
     partToDraw = 1;        // Start over.
     cancelAnyExistingTimer();
     singleshot(200,timeout());
}

// Draw the parts.
// If a new resize arrives, the process restarts
// in a short amount of time, without having to
// wait for the complete redraw to complete.
timeout() {
     drawPart(partToDraw)
     if( ++partToDraw != numberOfParts )
         singleshot(0,timeout();         // Return to event loop.

}


_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140225/46cf2647/attachment.html>


More information about the Interest mailing list