set default hints when repr doesn't export Layout.*

when we go from full to compact repr, if the compact
doesn't export a Layout attached property, the hints shouldn't
remain those of the full repr, so reset to default values

BUG:377153
Reviewed-by:Eike Hein
This commit is contained in:
Marco Martin 2017-03-03 17:52:41 +01:00
parent fba9e9e151
commit b99a87a320

View File

@ -92,7 +92,19 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item)
}
}
//if the compact repr doesn't export a Layout.* attached property,
//reset our own with default values
if (!layout) {
if (ownLayout) {
ownLayout->setProperty("minimumWidth", 0);
ownLayout->setProperty("minimumHeight", 0);
ownLayout->setProperty("preferredWidth", -1);
ownLayout->setProperty("preferredHeight", -1);
ownLayout->setProperty("maximumWidth", std::numeric_limits<qreal>::infinity());
ownLayout->setProperty("maximumHeight", std::numeric_limits<qreal>::infinity());
ownLayout->setProperty("fillWidth", false);
ownLayout->setProperty("fillHeight", false);
}
return;
}