[Interest] Update widget geometry BEFORE window shown

David M. Cotter dave at kjams.com
Thu May 30 00:18:45 CEST 2024


OMG I FIGURED IT OUT!!!

			qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, true);
			qWidgetP->show();
			QtLetTimersFire(0);
			qWidgetP->hide();
			qWidgetP->setAttribute(Qt::WA_DontShowOnScreen, false);


And here is QtLetTimersFire for completeness.

void	QtLetTimersFire(
	CFTimeInterval	durationT,		//	= 0.1
	bool		all_eventsB,	//	= false
	bool		extrasB)		//	= false
{
	//	don't let timers fire when this thread IS a timer
	if (!IsCooperativeThread()) {
		QEventLoop			loop;		//	MUST be on the stack for events to flow!
		QEventLoop::ProcessEventsFlags	flags(
			all_eventsB ? QEventLoop::AllEvents : QEventLoop::ExcludeUserInputEvents);

		CT_Timer::AvoidRecursiveTimer();

		if (durationT) {
			CFTimeIntervalMilliseconds	milliSecT(CFSecondsToMilliseconds(durationT));

			if (extrasB) {
				flags |= QEventLoop::WaitForMoreEvents | QEventLoop::EventLoopExec;
			}

			loop.processEvents(flags, milliSecT);
		} else {
			loop.processEvents(flags);
		}
	}
}




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240529/46701a03/attachment.htm>


More information about the Interest mailing list