check for validity

This commit is contained in:
Marco Martin 2014-01-31 20:03:33 +01:00
parent 89cb417e9f
commit b68bbca6c8

View File

@ -613,7 +613,12 @@ void DialogProxy::updateMinimumHeight()
void DialogProxy::updateMaximumWidth()
{
if (m_mainItemLayout) {
setMaximumWidth(m_mainItemLayout.data()->property("maximumWidth").toInt());
const int hint = m_mainItemLayout.data()->property("maximumWidth").toInt();
if (hint > 0) {
setMaximumWidth(hint);
} else {
setMaximumWidth(DIALOGSIZE_MAX);
}
} else {
setMaximumWidth(DIALOGSIZE_MAX);
}
@ -622,7 +627,12 @@ void DialogProxy::updateMaximumWidth()
void DialogProxy::updateMaximumHeight()
{
if (m_mainItemLayout) {
setMaximumHeight(m_mainItemLayout.data()->property("maximumWidth").toInt());
const int hint = m_mainItemLayout.data()->property("maximumHeight").toInt();
if (hint > 0) {
setMaximumWidth(hint);
} else {
setMaximumWidth(DIALOGSIZE_MAX);
}
} else {
setMaximumHeight(DIALOGSIZE_MAX);
}