connect conditionally to minimumWidthChanged

this removes warnings: not all declarative items will have this signals
This commit is contained in:
Marco Martin 2013-01-11 16:02:01 +01:00
parent a7f4cf52be
commit 8e7a995797

View File

@ -45,8 +45,13 @@ void DeclarativeItemContainer::setDeclarativeItem(QDeclarativeItem *item, bool r
connect(m_declarativeItem.data(), SIGNAL(widthChanged()), this, SLOT(widthChanged()));
connect(m_declarativeItem.data(), SIGNAL(heightChanged()), this, SLOT(heightChanged()));
QObject::connect(m_declarativeItem.data(), SIGNAL(minimumWidthChanged()), this, SLOT(minimumWidthChanged()));
QObject::connect(m_declarativeItem.data(), SIGNAL(minimumHeightChanged()), this, SLOT(minimumHeightChanged()));
if (m_declarativeItem.data()->metaObject()->indexOfProperty("minimumWidth") >= 0) {
QObject::connect(m_declarativeItem.data(), SIGNAL(minimumWidthChanged()), this, SLOT(minimumWidthChanged()));
}
if (m_declarativeItem.data()->metaObject()->indexOfProperty("minimumHeight") >= 0) {
QObject::connect(m_declarativeItem.data(), SIGNAL(minimumHeightChanged()), this, SLOT(minimumHeightChanged()));
}
minimumWidthChanged();
minimumHeightChanged();
}