CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | List of all members
ctkFlowLayout Class Reference

#include <Libs/Widgets/ctkFlowLayout.h>

Inheritance diagram for ctkFlowLayout:
Inheritance graph
[legend]
Collaboration diagram for ctkFlowLayout:
Collaboration graph
[legend]

Public Types

typedef QLayout Superclass
 

Public Member Functions

virtual void addItem (QLayoutItem *item)
 Reimplemented for internal reasons. More...
 
bool alignItems () const
 
virtual int count () const
 
 ctkFlowLayout (Qt::Orientation orientation, QWidget *parent=0)
 
 ctkFlowLayout (QWidget *parent)
 
 ctkFlowLayout ()
 
virtual Qt::Orientations expandingDirections () const
 
virtual bool hasHeightForWidth () const
 
virtual bool hasWidthForHeight () const
 
virtual int heightForWidth (int) const
 
int horizontalSpacing () const
 
virtual QLayoutItem * itemAt (int index) const
 
virtual QSize minimumSize () const
 
Qt::Orientation orientation () const
 
Qt::Orientations preferredExpandingDirections () const
 
void setAlignItems (bool)
 
virtual void setGeometry (const QRect &rect)
 
void setHorizontalSpacing (int)
 
void setOrientation (Qt::Orientation orientation)
 
void setPreferredExpandingDirections (Qt::Orientations directions)
 
void setVerticalSpacing (int)
 
virtual QSize sizeHint () const
 
virtual QLayoutItem * takeAt (int index)
 
int verticalSpacing () const
 
virtual int widthForHeight (int) const
 
virtual ~ctkFlowLayout ()
 

Static Public Member Functions

static ctkFlowLayoutreplaceLayout (QWidget *widget)
 

Protected Attributes

QScopedPointer< ctkFlowLayoutPrivate > d_ptr
 

Properties

bool alignItems
 
int horizontalSpacing
 
Qt::Orientation orientation
 
Qt::Orientations preferredExpandingDirections
 
int verticalSpacing
 

Detailed Description

Acts like a QBoxLayout but if the space is horizontally/vertically limited, it displays items ona a new row/column based on the orientation. Please note that using a Qt::Vertical orientation without the property alignItems set to true might result to weird layout behavior.

Definition at line 36 of file ctkFlowLayout.h.

Member Typedef Documentation

typedef QLayout ctkFlowLayout::Superclass

Definition at line 76 of file ctkFlowLayout.h.

Constructor & Destructor Documentation

ctkFlowLayout::ctkFlowLayout ( Qt::Orientation  orientation,
QWidget *  parent = 0 
)
explicit
ctkFlowLayout::ctkFlowLayout ( QWidget *  parent)
explicit
ctkFlowLayout::ctkFlowLayout ( )
explicit
virtual ctkFlowLayout::~ctkFlowLayout ( )
virtual

Member Function Documentation

virtual void ctkFlowLayout::addItem ( QLayoutItem *  item)
virtual

Reimplemented for internal reasons.

bool ctkFlowLayout::alignItems ( ) const
virtual int ctkFlowLayout::count ( ) const
virtual
virtual Qt::Orientations ctkFlowLayout::expandingDirections ( ) const
virtual
virtual bool ctkFlowLayout::hasHeightForWidth ( ) const
virtual
virtual bool ctkFlowLayout::hasWidthForHeight ( ) const
virtual

When the orientation is Qt::Vertical, heightForWidth doesn't work correctly with ctkFlowLayout. Ideally widthForHeight should be used instead.

See also
orientation widthForHeight hasHeightForWidth
virtual int ctkFlowLayout::heightForWidth ( int  ) const
virtual
int ctkFlowLayout::horizontalSpacing ( ) const
virtual QLayoutItem* ctkFlowLayout::itemAt ( int  index) const
virtual
virtual QSize ctkFlowLayout::minimumSize ( ) const
virtual
Qt::Orientation ctkFlowLayout::orientation ( ) const
Qt::Orientations ctkFlowLayout::preferredExpandingDirections ( ) const
static ctkFlowLayout* ctkFlowLayout::replaceLayout ( QWidget *  widget)
static

Replace the existing BoxLayout of the widget with a flow layout. When using the Designer, it is not possible to use a flow layout. Instead, you can use a H/VBoxLayout and replace it programatically in the setupUi() function with a flow layout. replaceLayout() makes the operation easier.

Todo:
replaceLayout should take an existing layout instead of a widget, indeed, a layout can have another layout as a parent, not only a widget.
void ctkFlowLayout::setAlignItems ( bool  )
virtual void ctkFlowLayout::setGeometry ( const QRect &  rect)
virtual
void ctkFlowLayout::setHorizontalSpacing ( int  )
void ctkFlowLayout::setOrientation ( Qt::Orientation  orientation)
void ctkFlowLayout::setPreferredExpandingDirections ( Qt::Orientations  directions)
void ctkFlowLayout::setVerticalSpacing ( int  )
virtual QSize ctkFlowLayout::sizeHint ( ) const
virtual
virtual QLayoutItem* ctkFlowLayout::takeAt ( int  index)
virtual
int ctkFlowLayout::verticalSpacing ( ) const
virtual int ctkFlowLayout::widthForHeight ( int  ) const
virtual

Member Data Documentation

QScopedPointer<ctkFlowLayoutPrivate> ctkFlowLayout::d_ptr
protected

Definition at line 127 of file ctkFlowLayout.h.

Property Documentation

bool ctkFlowLayout::alignItems
readwrite

Force the items to be horizontally aligned based on the largest item to display. True by default.

See also
orientation

Definition at line 61 of file ctkFlowLayout.h.

int ctkFlowLayout::horizontalSpacing
readwrite

Horizontal space between items, if the spacing is <0, a default spacing set on the parent/style is used. -1 by default.

See also
verticalSpacing

Definition at line 67 of file ctkFlowLayout.h.

Qt::Orientation ctkFlowLayout::orientation
readwrite

If orientation is Qt::Horizontal, items are layed out from left to right then top to bottom if there is no more horizontal space. If orientation is Qt::Vertical, items are layed out from top to bottom then left to right if there is no more vertical space. Qt::Horizontal by default

See also
preferredExpandingDirections

Definition at line 45 of file ctkFlowLayout.h.

Qt::Orientations ctkFlowLayout::preferredExpandingDirections
readwrite

Indicates how the size hint of the layout should behave. The preferred expanding direction can be different than the orientation of the layout. It can be a combination of Qt::Horizontal and Qt::Vertical, in that case the layout will try to expand in a square shape (evenly distribute the number of rows and columns). Qt::Horizontal | Qt::Vertical by default.

See also
orientation

Definition at line 55 of file ctkFlowLayout.h.

int ctkFlowLayout::verticalSpacing
readwrite

Vertical space between items, if the spacing is <0, a default spacing set on the parent/style is used. -1 by default.

See also
horizontalSpacing

Definition at line 73 of file ctkFlowLayout.h.


The documentation for this class was generated from the following file: