Dialog: updateLayoutParameters after calling syncToMainItemSize

updateLayoutParameters's uses the borders in order to set the max and
minimum size, and therefore syncToMainItemSize should always be called
before it is ever called.

Also added code to not do anything if we are not completely initialized.
This commit is contained in:
Vishesh Handa 2014-09-16 14:57:10 +02:00
parent 18a6a7302b
commit 6f2c46807e

View File

@ -239,6 +239,9 @@ void DialogPrivate::updateVisibility(bool visible)
cachedGeometry = QRect();
}
syncToMainItemSize();
if (mainItemLayout) {
updateLayoutParameters();
}
}
}
@ -424,7 +427,7 @@ void DialogPrivate::updateMaximumHeight()
void DialogPrivate::updateLayoutParameters()
{
if (!componentComplete) {
if (!componentComplete || !mainItem || !q->isVisible()) {
return;
}
Q_ASSERT(mainItem);