# class KContainerLayout | Alternative Layout manager widget. More...
Definition | `#include <kcontainer.h>`
Inherits | QFrame (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum { Horizontal = 0, Vertical }

#### Public Methods

- KContainerLayout (QWidget * parent=0, const char * name=0, int orientation = KContainerLayout::Horizontal, bool homogeneos = FALSE, int spacing = 5, WFlags f=0, bool allowLines=TRUE)
- virtual ~KContainerLayout ()
- int getNumberOfWidgets () const
- int packStart (QWidget *w, bool e=FALSE, bool f=FALSE,int p=1)
- int packEnd (QWidget *w, bool e=FALSE, bool f=FALSE,int p=1)
- void setOrientation (int i)
- void setHomogeneos (bool b)
- void setSpacing (int i)
- void setStartOffset (int i)
- void setEndOffset (int i)
- int orientation () const
- bool homogeneos () const
- int spacing () const
- int startOffset () const
- int endOffset () const
- void sizeToFit ()

#### Protected Types

- class KContainerLayoutItem

#### Protected Methods

- void recalcLayout ()
- QSize widgetSize (KContainerLayoutItem *item)
- void repositionWidgets ()
- int numberOfWidgetsWithExpand ()
- void calculateSizeHint ()
- QSize sizeOfLargerWidget ()
- QSize idealSizeOfWidget (KContainerLayoutItem *item)
- bool horizontal () const
- virtual void resizeEvent (QResizeEvent *ev)
- virtual bool eventFilter (QObject *, QEvent *ev)
- virtual QSize sizeHint () const

#### Protected Members

- int _orientation
- bool _homogeneos
- int _spacing
- int _startOffset
- int _endOffset
- QList<KContainerLayoutItem> _startWidgets
- QList<KContainerLayoutItem> _endWidgets
- int _sizeForEach
- QSize _sizeHint

## Detailed Description

Alternative Layout manager widget. Here is an example of using this class:

enum { Horizontal = 0, Vertical } | ###

KContainerLayout (QWidget * parent=0, const char * name=0, int orientation = KContainerLayout::Horizontal, bool homogeneos = FALSE, int spacing = 5, WFlags f=0, bool allowLines=TRUE) | ### KContainerLayout

Constructs a KContainerLayout as child of parent

Parameters:

parent | The parent widget of the KContainerLayout
name | The name of the widget
orientation | The orientation of the container, either KContainerLayout::Horizontal or KContainer::Vertical
homogeneous | If the container should split available size by all KContainerLayoutItem in equal parts
spacing | The space to add between each widget and between the first/last and the borders
f | Flags (see QFrameQFrame)
allowLines | Flags (see QFrameQFrame)

~KContainerLayout () | ### ~KContainerLayout

[virtual]

The destructor

int getNumberOfWidgets () | ### getNumberOfWidgets

[const]

Returns the number of widgets inside this container

int packStart (QWidget *w, bool e=FALSE, bool f=FALSE,int p=1) | ### packStart

Pack one widget to the start of the container after the previously packed on start widgets

Parameters:

w | The widget to be packed
e | If the widget should use the whole size allocated to it
f | If the widget should be sized to fill the whole space allocated to it (only makes sense with Expand=TRUE)
p | Padding that should be used as the borders in each side of the widget

int packEnd (QWidget *w, bool e=FALSE, bool f=FALSE,int p=1) | ### packEnd

Pack one widget to the end of the container after the previously packed on end widgets

Parameters:

w | The widget to be packed
e | If the widget should use the whole size allocated to it
f | If the widget should be sized to fill the whole space allocated to it (only makes sense with Expand=TRUE)
p | Padding that should be used as the borders in each side of the widget

void setOrientation (int i) | ### setOrientation

Sets the orientation of the container, one of KContainerLayout::Horizontal or KContainer::Vertical

void setHomogeneos (bool b) | ### setHomogeneos

Sets the container to use the same size to each widget he contains (TRUE) or not (FALSE) When homogeneous is true all widgets will be packed as if they had the Expand set to TRUE

See also: packStart, KContainer#packEnd

void setSpacing (int i) | ### setSpacing

void setStartOffset (int i) | ### setStartOffset

Sets the starting offset for this container

See also: _startOffset

void setEndOffset (int i) | ### setEndOffset

Sets the ending offset for this container

See also: _endOffset

int orientation () | ### orientation

[const]

Returns the current orientation of the container

See also: setOrientation

bool homogeneos () | ### homogeneos

[const]

Returns the current homogeneous state of the container

See also: KContainerLayout#setHomogeneous

int spacing () | ### spacing

[const]

Returns the current spacing of the container

See also: setSpacing

int startOffset () | ### startOffset

[const]

Returns the starting offset for this container

See also: _startOffset

int endOffset () | ### endOffset

[const]

Returns the ending offset for this container

See also: _endOffset

void sizeToFit () | ### sizeToFit

Resizes the container to be as small as necessary to display all widgets

KContainerLayoutItem (class) | ### KContainerLayoutItem

[protected]

This class represents one widget inside the one KContainerLayout.

See also: KContainerLayout

void recalcLayout () | ### recalcLayout

[protected]

Calculates the size necessary to display all widgets

QSize widgetSize (KContainerLayoutItem *item) | ### widgetSize

[protected]

Returns the size necessary for the widget represented by this KContainerLayoutItem

void repositionWidgets () | ### repositionWidgets

[protected]

Reposition all widgets on the container.

int numberOfWidgetsWithExpand () | ### numberOfWidgetsWithExpand

[protected]

Returns the number of widgets that share the extra space on the container.

void calculateSizeHint () | ### calculateSizeHint

[protected]

Calculate our size hint based on the sizeHint() of all out widgets, on our properties - expand and homogeneous, and on the KContainerLayoutItem properties.

See also: KContainerLayoutItem, packStart, packEnd

QSize sizeOfLargerWidget () | ### sizeOfLargerWidget

[protected]

Return the size necessary by the largest widget on the container.

QSize idealSizeOfWidget (KContainerLayoutItem *item) | ### idealSizeOfWidget

[protected]

Returns the ideal size for the widget represented by this KContainerLayoutItem.

bool horizontal () | ### horizontal

[protected const]

Return TRUE if this is an horizontal container.

void resizeEvent (QResizeEvent *ev) | ### resizeEvent

[protected virtual]

Resizes the widget and repositions all widgets.

Reimplemented from QFrame.

bool eventFilter (QObject *, QEvent *ev) | ### eventFilter

[protected virtual]

Used to filter resize events from our parent if it isn't a KContainerLayout.

QSize sizeHint () | ### sizeHint

[protected const virtual]

Returns our size hint. The size necessary to display this container.

Reimplemented from QFrame.

int _orientation | ### _orientation

[protected]

bool _homogeneos | ### _homogeneos

[protected]

int _spacing | ### _spacing

[protected]

int _startOffset | ### _startOffset

[protected]

int _endOffset | ### _endOffset

[protected]

QList<KContainerLayoutItem> _startWidgets | ### _startWidgets

[protected]

QList<KContainerLayoutItem> _endWidgets | ### _endWidgets

[protected]

int _sizeForEach | ### _sizeForEach

[protected]

QSize _sizeHint | ### _sizeHint

[protected]

- Version: 0.1
- Author: Jorge Monteiro <jomo@casema.net>
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:37:45 2001, using kdoc 2.0a53.