using QskControl::LayoutHints
This commit is contained in:
parent
72aee9970c
commit
27bb868f9d
|
@ -711,13 +711,13 @@ qreal QskControl::heightForWidth( qreal width ) const
|
||||||
|
|
||||||
d->blockLayoutRequestEvents = false;
|
d->blockLayoutRequestEvents = false;
|
||||||
|
|
||||||
if ( !d->autoLayoutChildren )
|
if ( d->autoLayoutChildren )
|
||||||
|
{
|
||||||
|
return constrainedMetric( QskLayoutConstraint::HeightForWidth,
|
||||||
|
this, width, QskLayoutConstraint::constrainedChildrenMetric );
|
||||||
|
}
|
||||||
|
|
||||||
return -1.0;
|
return -1.0;
|
||||||
|
|
||||||
using namespace QskLayoutConstraint;
|
|
||||||
|
|
||||||
return constrainedMetric(
|
|
||||||
HeightForWidth, this, width, constrainedChildrenMetric );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskControl::widthForHeight( qreal height ) const
|
qreal QskControl::widthForHeight( qreal height ) const
|
||||||
|
@ -726,13 +726,13 @@ qreal QskControl::widthForHeight( qreal height ) const
|
||||||
|
|
||||||
d->blockLayoutRequestEvents = false;
|
d->blockLayoutRequestEvents = false;
|
||||||
|
|
||||||
if ( !d->autoLayoutChildren )
|
if ( d->autoLayoutChildren )
|
||||||
|
{
|
||||||
|
return constrainedMetric( QskLayoutConstraint::WidthForHeight,
|
||||||
|
this, height, QskLayoutConstraint::constrainedChildrenMetric );
|
||||||
|
}
|
||||||
|
|
||||||
return -1.0;
|
return -1.0;
|
||||||
|
|
||||||
using namespace QskLayoutConstraint;
|
|
||||||
|
|
||||||
return constrainedMetric(
|
|
||||||
WidthForHeight, this, height, constrainedChildrenMetric );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QskControl::event( QEvent* event )
|
bool QskControl::event( QEvent* event )
|
||||||
|
@ -924,10 +924,13 @@ void QskControl::updateItemPolish()
|
||||||
const auto children = childItems();
|
const auto children = childItems();
|
||||||
for ( auto child : children )
|
for ( auto child : children )
|
||||||
{
|
{
|
||||||
|
// checking qskIsVisibleToParent ???
|
||||||
if ( !qskIsTransparentForPositioner( child ) )
|
if ( !qskIsTransparentForPositioner( child ) )
|
||||||
{
|
{
|
||||||
// rect = QskLayoutConstraint::itemRect( info.item, rect, ... );
|
const auto itemRect = QskLayoutConstraint::boundedRect(
|
||||||
qskSetItemGeometry( child, rect );
|
child, rect, QskLayoutConstraint::layoutAlignmentHint( child ) );
|
||||||
|
|
||||||
|
qskSetItemGeometry( child, itemRect );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,12 +221,15 @@ qreal QskLayoutConstraint::constrainedChildrenMetric(
|
||||||
for ( auto child : children )
|
for ( auto child : children )
|
||||||
{
|
{
|
||||||
if ( !qskIsTransparentForPositioner( child ) )
|
if ( !qskIsTransparentForPositioner( child ) )
|
||||||
|
{
|
||||||
|
if ( qskIsVisibleToParent( child ) || retainSizeWhenHidden( child ) )
|
||||||
{
|
{
|
||||||
const auto v = constrainFunction( child, constraint );
|
const auto v = constrainFunction( child, constraint );
|
||||||
if ( v > constrainedValue )
|
if ( v > constrainedValue )
|
||||||
constrainedValue = v;
|
constrainedValue = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return constrainedValue;
|
return constrainedValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue