gtk_widget_gedon't block consecutive LayoutRequest

events as we don't know, when the receiver will have processed them
This commit is contained in:
Uwe Rathmann 2018-12-11 14:58:48 +01:00
parent 9a1e46e0ba
commit a9f059ede3
1 changed files with 9 additions and 7 deletions

View File

@ -1363,11 +1363,14 @@ void QskControl::resetImplicitSize()
if ( d->controlFlags & QskControl::DeferredLayout ) if ( d->controlFlags & QskControl::DeferredLayout )
{ {
if ( !d->blockedImplicitSize ) /*
{ Is there a way to block consecutive calls ?
d->blockedImplicitSize = true; When the parent is requesting the preferred size, we could use
layoutConstraintChanged(); 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 else
{ {
@ -1743,8 +1746,7 @@ void QskControl::windowDeactivateEvent()
void QskControl::layoutConstraintChanged() void QskControl::layoutConstraintChanged()
{ {
QQuickItem* item = parentItem(); if ( auto item = parentItem() )
if ( item )
qskSendEventTo( item, QEvent::LayoutRequest ); qskSendEventTo( item, QEvent::LayoutRequest );
} }