Version: 9.12.0
QtxGridBox Class Reference

A container widget with possibility to automatically layout child widgets. More...

#include <QtxGridBox.h>

Inheritance diagram for QtxGridBox:
Inheritance graph

Classes

class  Space
 Represents a space in the grid box. More...
 

Public Member Functions

 QtxGridBox (QWidget *=0, const int=5, const int=5)
 Constructor. More...
 
 QtxGridBox (const int, Qt::Orientation, QWidget *=0, const int=5, const int=5)
 Constructor. More...
 
virtual ~QtxGridBox ()
 Destructor. More...
 
int columns () const
 Get number of grid box columns/rows (depending on the orientation). More...
 
Qt::Orientation orientation () const
 Get the grid box orientation. More...
 
void setColumns (const int)
 Set number of grid box columns/rows (depending on the orientation). More...
 
void setOrientation (Qt::Orientation)
 Set the grid box orientation. More...
 
void setLayout (const int, Qt::Orientation)
 Initialize internal layout. More...
 
bool skipInvisible () const
 Get "skip invisible widgets" flags. More...
 
void setSkipInvisible (const bool)
 Set "skip invisible widgets" flags. More...
 
void addSpace (const int)
 Add space (empty cell) to the grid box. More...
 
int insideMargin () const
 Get grid box's inside margin size. More...
 
int insideSpacing () const
 Get grid box's inside spacing size. More...
 
void setInsideMargin (const int)
 Set grid box's inside margin size. More...
 
void setInsideSpacing (const int)
 Set grid box's inside spacing size. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Custom event filter. More...
 

Protected Member Functions

void childEvent (QChildEvent *)
 Customize child event. More...
 

Private Member Functions

void skip ()
 Increment the grid box current cell. More...
 
void arrangeWidgets ()
 Arrange child widgets. More...
 
void placeWidget (QWidget *)
 Place new widget to the current grid box cell. More...
 

Private Attributes

int myCols
 
bool mySkip
 
Qt::Orientation myOrient
 
QGridLayout * myLayout
 
int myCol
 
int myRow
 

Detailed Description

A container widget with possibility to automatically layout child widgets.

Constructor & Destructor Documentation

◆ QtxGridBox() [1/2]

QtxGridBox::QtxGridBox ( QWidget parent = 0,
const int  m = 5,
const int  s = 5 
)

Constructor.

Parameters
parentparent widget
mgrid box margin
sgrid box spacing

References myLayout.

◆ QtxGridBox() [2/2]

QtxGridBox::QtxGridBox ( const int  cols,
Qt::Orientation  o,
QWidget parent = 0,
const int  m = 5,
const int  s = 5 
)

Constructor.

Parameters
colsnumber of grid box columns or rows (depending on the orientation)
ogrid box orientation
parentparent widget
mgrid box margin
sgrid box spacing

References myLayout.

◆ ~QtxGridBox()

QtxGridBox::~QtxGridBox ( )
virtual

Destructor.

Member Function Documentation

◆ addSpace()

void QtxGridBox::addSpace ( const int  sp)

Add space (empty cell) to the grid box.

Parameters
sprequied space size

◆ arrangeWidgets()

void QtxGridBox::arrangeWidgets ( )
private

Arrange child widgets.

References myCol, myLayout, myRow, placeWidget(), and skipInvisible().

◆ childEvent()

void QtxGridBox::childEvent ( QChildEvent *  e)
protected

Customize child event.

Parameters
echild event

References placeWidget().

◆ columns()

int QtxGridBox::columns ( ) const

Get number of grid box columns/rows (depending on the orientation).

Returns
number of columns (rows)

References myCols.

◆ eventFilter()

bool QtxGridBox::eventFilter ( QObject o,
QEvent e 
)
virtual

Custom event filter.

Parameters
oevent receiver object.
eevent
Returns
true if the event processing should be stopped

References arrangeWidgets(), and skipInvisible().

◆ insideMargin()

int QtxGridBox::insideMargin ( ) const

Get grid box's inside margin size.

Returns
inside margin size

References myLayout.

◆ insideSpacing()

int QtxGridBox::insideSpacing ( ) const

Get grid box's inside spacing size.

Returns
inside spacing size

References myLayout.

◆ orientation()

Qt::Orientation QtxGridBox::orientation ( ) const

Get the grid box orientation.

Returns
orientation

References myOrient.

◆ placeWidget()

void QtxGridBox::placeWidget ( QWidget wid)
private

Place new widget to the current grid box cell.

Parameters
widwidget being inserted

References myCol, myLayout, myRow, and skip().

◆ setColumns()

void QtxGridBox::setColumns ( const int  cols)

Set number of grid box columns/rows (depending on the orientation).

Parameters
colsnumber of columns (rows)

References orientation(), and setLayout().

◆ setInsideMargin()

void QtxGridBox::setInsideMargin ( const int  m)

Set grid box's inside margin size.

Parameters
mnew inside margin size

References myLayout.

◆ setInsideSpacing()

void QtxGridBox::setInsideSpacing ( const int  s)

Set grid box's inside spacing size.

Parameters
snew inside spacing size

References myLayout.

◆ setLayout()

void QtxGridBox::setLayout ( const int  cols,
Qt::Orientation  o 
)

Initialize internal layout.

Parameters
colsnumber of columns (rows)
oorientation

References arrangeWidgets(), myCols, and myOrient.

◆ setOrientation()

void QtxGridBox::setOrientation ( Qt::Orientation  o)

Set the grid box orientation.

Parameters
oorientation

References columns(), and setLayout().

◆ setSkipInvisible()

void QtxGridBox::setSkipInvisible ( const bool  on)

Set "skip invisible widgets" flags.

If this flag is set to false, invisible widgets are not taken into account when layouting widgets.

Parameters
onnew flag state

References arrangeWidgets(), and mySkip.

◆ skip()

void QtxGridBox::skip ( )
private

Increment the grid box current cell.

References columns(), Horizontal, myCol, myRow, and orientation().

◆ skipInvisible()

bool QtxGridBox::skipInvisible ( ) const

Get "skip invisible widgets" flags.

Returns
current flag state

References mySkip.

Member Data Documentation

◆ myCol

int QtxGridBox::myCol
private

◆ myCols

int QtxGridBox::myCols
private

◆ myLayout

QGridLayout* QtxGridBox::myLayout
private

◆ myOrient

Qt::Orientation QtxGridBox::myOrient
private

◆ myRow

int QtxGridBox::myRow
private

◆ mySkip

bool QtxGridBox::mySkip
private

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