Logo Search packages:      
Sourcecode: qt4-x11 version File versions

int QWidget::heightForWidth ( int  w  )  const [virtual, inherited]

Returns the preferred height for this widget, given the width w.

If this widget has a layout, the default implementation returns the layout's preferred height. if there is no layout, the default implementation returns -1 indicating that the preferred height does not depend on the width.

Reimplemented in QLabel, QMenuBar, and Q3TextEdit.

Definition at line 7004 of file qwidget.cpp.

References QWidget::layout(), and QLayout::totalHeightForWidth().

Referenced by QWidget::adjustSize(), QLabel::heightForWidth(), and QWidgetItem::heightForWidth().

    if (layout() && layout()->hasHeightForWidth())
        return layout()->totalHeightForWidth(w);
    return -1;

Generated by  Doxygen 1.6.0   Back to index