diff --git a/scriptengines/javascript/declarative/declarativeitemcontainer.cpp b/scriptengines/javascript/declarative/declarativeitemcontainer.cpp index ef0eb77d0..b23f6c7a0 100644 --- a/scriptengines/javascript/declarative/declarativeitemcontainer.cpp +++ b/scriptengines/javascript/declarative/declarativeitemcontainer.cpp @@ -44,6 +44,11 @@ void DeclarativeItemContainer::setDeclarativeItem(QDeclarativeItem *item, bool r resize(item->width(), item->height()); 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())); + minimumWidthChanged(); + minimumHeightChanged(); } QDeclarativeItem *DeclarativeItemContainer::declarativeItem() const @@ -86,4 +91,25 @@ void DeclarativeItemContainer::heightChanged() resize(newSize); } +void DeclarativeItemContainer::minimumWidthChanged() +{ + if (!m_declarativeItem) { + return; + } + + qreal minimumWidth = m_declarativeItem.data()->property("minimumWidth").toReal(); + setMinimumWidth(minimumWidth); +} + +void DeclarativeItemContainer::minimumHeightChanged() +{ + if (!m_declarativeItem) { + return; + } + + qreal minimumHeight = m_declarativeItem.data()->property("minimumHeight").toReal(); + setMinimumHeight(minimumHeight); +} + + #include "declarativeitemcontainer_p.moc" diff --git a/scriptengines/javascript/declarative/declarativeitemcontainer_p.h b/scriptengines/javascript/declarative/declarativeitemcontainer_p.h index d900fff94..27d2f1dcc 100644 --- a/scriptengines/javascript/declarative/declarativeitemcontainer_p.h +++ b/scriptengines/javascript/declarative/declarativeitemcontainer_p.h @@ -44,6 +44,8 @@ protected: protected Q_SLOTS: void widthChanged(); void heightChanged(); + void minimumWidthChanged(); + void minimumHeightChanged(); private: QWeakPointer m_declarativeItem;