From a9f059ede3bc035e490fff340611665e32f837df Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Tue, 11 Dec 2018 14:58:48 +0100 Subject: [PATCH] gtk_widget_gedon't block consecutive LayoutRequest events as we don't know, when the receiver will have processed them --- src/controls/QskControl.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/controls/QskControl.cpp b/src/controls/QskControl.cpp index c01b251f..3f0e2ca2 100644 --- a/src/controls/QskControl.cpp +++ b/src/controls/QskControl.cpp @@ -1363,11 +1363,14 @@ void QskControl::resetImplicitSize() if ( d->controlFlags & QskControl::DeferredLayout ) { - if ( !d->blockedImplicitSize ) - { - d->blockedImplicitSize = true; - layoutConstraintChanged(); - } + /* + Is there a way to block consecutive calls ? + When the parent is requesting the preferred size, we could use + d->blockedImplicitSize, but in case of dynamic constraints we don't + have an indication when the event has been processed. TODO ... + */ + d->blockedImplicitSize = true; + layoutConstraintChanged(); } else { @@ -1743,8 +1746,7 @@ void QskControl::windowDeactivateEvent() void QskControl::layoutConstraintChanged() { - QQuickItem* item = parentItem(); - if ( item ) + if ( auto item = parentItem() ) qskSendEventTo( item, QEvent::LayoutRequest ); }