support minimumSize in the compactRepresentation
This commit is contained in:
parent
4698241d8d
commit
2084d29735
@ -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"
|
||||
|
@ -44,6 +44,8 @@ protected:
|
||||
protected Q_SLOTS:
|
||||
void widthChanged();
|
||||
void heightChanged();
|
||||
void minimumWidthChanged();
|
||||
void minimumHeightChanged();
|
||||
|
||||
private:
|
||||
QWeakPointer<QDeclarativeItem> m_declarativeItem;
|
||||
|
Loading…
Reference in New Issue
Block a user