From 8e7a9957973b372fb7fe05b0f290643835b73da9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 11 Jan 2013 16:02:01 +0100 Subject: [PATCH] connect conditionally to minimumWidthChanged this removes warnings: not all declarative items will have this signals --- .../javascript/declarative/declarativeitemcontainer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scriptengines/javascript/declarative/declarativeitemcontainer.cpp b/scriptengines/javascript/declarative/declarativeitemcontainer.cpp index b23f6c7a0..466274623 100644 --- a/scriptengines/javascript/declarative/declarativeitemcontainer.cpp +++ b/scriptengines/javascript/declarative/declarativeitemcontainer.cpp @@ -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(); }