[Interest] Finished resizing a window?

John Weeks john at wavemetrics.com
Wed Mar 5 19:45:50 CET 2014


On 24-Feb-2014, at 3:45 PM, Tony Rietwyk wrote:

> Good luck - please let the group know what you decide with this.


I finally went with a timer:

void grafRec::doResizeEvent(QResizeEvent * event)
{
	lastResizeRect.left = lastResizeRect.top = 0;
	lastResizeRect.right = event->size().width();
	lastResizeRect.bottom = event->size().height();

	if (lastFullRedrawTime > SLOWDRAWINGGRAPHTIME)
	{
		if (_growTimer.isActive())
			_growTimer.setInterval(SLOWGRAPHRESIZEWAIT);
		else
			_growTimer.start();
	}
	else
	{
		DoGrfGrow(this, &lastResizeRect);
		DirtifyThisGraf(this);
	}
}

void grafRec::_onGrowTimerTimedOut()
{
	DoGrfGrow(this, &lastResizeRect);
	DirtifyThisGraf(this);
}

If the graph took more than 0.2 seconds to draw the last time it was painted, then the timer is set to time out in 0.2 s. 

-John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140305/9a1151d5/attachment.html>


More information about the Interest mailing list