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

int QStyle::layoutSpacing ( QSizePolicy::ControlType  control1,
QSizePolicy::ControlType  control2,
Qt::Orientation  orientation,
const QStyleOption option = 0,
const QWidget widget = 0 
) const [inherited]

Since:
4.3
Returns the spacing that should be used between control1 and control2 in a layout. orientation specifies whether the controls are laid out side by side or stacked vertically. The option parameter can be used to pass extra information about the parent widget. The widget parameter is optional and can also be used if option is 0.

This function is called by the layout system. It is used only if PM_LayoutHorizontalSpacing or PM_LayoutVerticalSpacing returns a negative value.

For binary compatibility reasons, this function is not virtual. If you want to specify custom layout spacings in a QStyle subclass, implement a slot called layoutSpacingImplementation(). QStyle will discover the slot at run-time (using Qt's {meta-object system}) and direct all calls to layoutSpacing() to layoutSpacingImplementation().

See also:
combinedLayoutSpacing(), layoutSpacingImplementation()

Definition at line 2203 of file qstyle.cpp.

Referenced by QStyle::combinedLayoutSpacing().

{
    Q_D(const QStyle);
    if (d->layoutSpacingIndex == -1) {
        d->layoutSpacingIndex = metaObject()->indexOfMethod(
            "layoutSpacingImplementation(QSizePolicy::ControlType,QSizePolicy::ControlType,"
            "Qt::Orientation,const QStyleOption*,const QWidget*)"
            );
    }
    if (d->layoutSpacingIndex < 0)
        return -1;
    int result;
    void *param[] = {&result, &control1, &control2, &orientation, &option, &widget};

    const_cast<QStyle *>(this)->qt_metacall(QMetaObject::InvokeMetaMethod,
                                            d->layoutSpacingIndex, param);
    return result;
}


Generated by  Doxygen 1.6.0   Back to index