Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxGridBox Class Reference

A container widget with possibility to automatically layout child widgets.

#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
 

Constructor & Destructor Documentation

QtxGridBox::QtxGridBox ( QWidget parent = 0,
const int  m = 5,
const int  s = 5 
)
Parameters
parentparent widget
mgrid box margin
sgrid box spacing

References myLayout.

QtxGridBox::QtxGridBox ( const int  cols,
Qt::Orientation  o,
QWidget parent = 0,
const int  m = 5,
const int  s = 5 
)
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 ( )
virtual

Member Function Documentation

void QtxGridBox::addSpace ( const int  sp)
Parameters
sprequied space size
void QtxGridBox::arrangeWidgets ( )
private
void QtxGridBox::childEvent ( QChildEvent *  e)
protected
Parameters
echild event

References placeWidget().

int QtxGridBox::columns ( ) const
Returns
number of columns (rows)

References myCols.

bool QtxGridBox::eventFilter ( QObject o,
QEvent e 
)
virtual
Parameters
oevent receiver object.
eevent
Returns
true if the event processing should be stopped

References arrangeWidgets(), and skipInvisible().

int QtxGridBox::insideMargin ( ) const
Returns
inside margin size

References myLayout.

int QtxGridBox::insideSpacing ( ) const
Returns
inside spacing size

References myLayout.

Qt::Orientation QtxGridBox::orientation ( ) const
Returns
orientation

References myOrient.

void QtxGridBox::placeWidget ( QWidget wid)
private
Parameters
widwidget being inserted

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

void QtxGridBox::setColumns ( const int  cols)
Parameters
colsnumber of columns (rows)

References orientation(), and setLayout().

void QtxGridBox::setInsideMargin ( const int  m)
Parameters
mnew inside margin size

References myLayout.

void QtxGridBox::setInsideSpacing ( const int  s)
Parameters
snew inside spacing size

References myLayout.

void QtxGridBox::setLayout ( const int  cols,
Qt::Orientation  o 
)
Parameters
colsnumber of columns (rows)
oorientation

References arrangeWidgets(), myCols, and myOrient.

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

References columns(), and setLayout().

void QtxGridBox::setSkipInvisible ( const bool  on)

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.

void QtxGridBox::skip ( )
private
bool QtxGridBox::skipInvisible ( ) const
Returns
current flag state

References mySkip.

Member Data Documentation

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

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