Example #1
0
// ------------------ QDesignerWidgetItem
QDesignerWidgetItem::QDesignerWidgetItem(const QLayout *containingLayout, QWidget *w, Qt::Orientations o) :
    QWidgetItemV2(w),
    m_orientations(o),
    m_nonLaidOutMinSize(w->minimumSizeHint()),
    m_nonLaidOutSizeHint(w->sizeHint()),
    m_cachedContainingLayout(containingLayout)
{
    // Initialize the minimum size to prevent nonlaid-out frames/widgets
    // from being slammed to zero
    const QSize minimumSize = w->minimumSize();
    if (!minimumSize.isEmpty())
        m_nonLaidOutMinSize = minimumSize;
    expand(&m_nonLaidOutMinSize);
    expand(&m_nonLaidOutSizeHint);
    w->installEventFilter(this);
    connect(containingLayout, SIGNAL(destroyed()), this, SLOT(layoutChanged()));
    if (DebugWidgetItem )
        qDebug() << "QDesignerWidgetItem"  << w <<  sizePolicyToString(w->sizePolicy()) << m_nonLaidOutMinSize << m_nonLaidOutSizeHint;
}
void SizePolicyEditor::setValue(const QSizePolicy &aValue)
{
    mValue=aValue;

    ui->valueEdit->setText(sizePolicyToString(mValue));
}