Version: 9.12.0
QtxGroupBox Class Reference

Enhanced group box widget. More...

#include <QtxGroupBox.h>

Inheritance diagram for QtxGroupBox:
Inheritance graph

Public Slots

virtual void setVisible (bool)
 Show/hide group box. More...
 

Public Member Functions

 QtxGroupBox (QWidget *=0)
 Constructor. More...
 
 QtxGroupBox (const QString &, QWidget *=0)
 Constructor. More...
 
virtual ~QtxGroupBox ()
 Destructor. More...
 
virtual void insertTitleWidget (QWidget *)
 Add widget to the group box title. More...
 
virtual void removeTitleWidget (QWidget *)
 Remove widget from the group box title. More...
 
virtual QSize sizeHint () const
 Get recommended size for the widget. More...
 
virtual QSize minimumSizeHint () const
 Get recommended minimum size for the widget. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Custom event filter. More...
 
QWidgetwidget () const
 Get central widget (or first found one). More...
 
void setWidget (QWidget *)
 Set central widget to the group box. More...
 

Protected Member Functions

virtual void childEvent (QChildEvent *)
 Customize child event. More...
 
virtual void resizeEvent (QResizeEvent *)
 Customize resize event. More...
 
virtual void customEvent (QEvent *)
 Process custom events. More...
 

Private Member Functions

void initialize ()
 Initialize the group box. More...
 
void updateTitle ()
 Update the group box title. More...
 
QSize titleSize () const
 Get the group box title size. More...
 
void setInsideMargin (const int)
 Set group box's inside margin size. More...
 
QSize expandTo (const QSize &) const
 Expand group box to the specified size. More...
 

Private Attributes

QWidgetmyContainer
 

Detailed Description

Enhanced group box widget.

The QtxGroupBox class allows inserting custom widgets in the group box title. Use insertTitleWidget() method to add custom widget to the title and removeTitleWidget() to remove it.

Constructor & Destructor Documentation

◆ QtxGroupBox() [1/2]

QtxGroupBox::QtxGroupBox ( QWidget parent = 0)

Constructor.

Parameters
parentparent widget

References initialize().

◆ QtxGroupBox() [2/2]

QtxGroupBox::QtxGroupBox ( const QString &  title,
QWidget parent = 0 
)

Constructor.

Parameters
titlegroup box title text
parentparent widget

References initialize().

◆ ~QtxGroupBox()

QtxGroupBox::~QtxGroupBox ( )
virtual

Destructor.

Member Function Documentation

◆ childEvent()

void QtxGroupBox::childEvent ( QChildEvent *  e)
protectedvirtual

Customize child event.

Parameters
echild event

◆ customEvent()

void QtxGroupBox::customEvent ( QEvent )
protectedvirtual

Process custom events.

Parameters
ecustom event (not used)

References updateTitle().

◆ eventFilter()

bool QtxGroupBox::eventFilter ( QObject obj,
QEvent e 
)
virtual

Custom event filter.

Parameters
objevent receiver
eevent
Returns
true if event processing should be stopped

References myContainer.

◆ expandTo()

QSize QtxGroupBox::expandTo ( const QSize &  sz) const
private

Expand group box to the specified size.

Parameters
sznew size

References myContainer, and titleSize().

◆ initialize()

void QtxGroupBox::initialize ( )
private

Initialize the group box.

Creates horizontal box as container for title widgets.

References myContainer, and updateTitle().

◆ insertTitleWidget()

void QtxGroupBox::insertTitleWidget ( QWidget wid)
virtual

Add widget to the group box title.

Parameters
widwidget being added to the title

References myContainer, and updateTitle().

◆ minimumSizeHint()

QSize QtxGroupBox::minimumSizeHint ( ) const
virtual

Get recommended minimum size for the widget.

Returns
recommended minimum size for the widget

References expandTo().

◆ removeTitleWidget()

void QtxGroupBox::removeTitleWidget ( QWidget wid)
virtual

Remove widget from the group box title.

Parameters
widwidget to be removed from the title

References myContainer, and updateTitle().

◆ resizeEvent()

void QtxGroupBox::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Customize resize event.

Parameters
eresize event

References updateTitle().

◆ setInsideMargin()

void QtxGroupBox::setInsideMargin ( const int  m)
private

Set group box's inside margin size.

Parameters
mnew inside margin size

◆ setVisible

void QtxGroupBox::setVisible ( bool  on)
virtualslot

Show/hide group box.

Parameters
onif true, show group box, otherwise, hide it

References updateTitle().

◆ setWidget()

void QtxGroupBox::setWidget ( QWidget wid)

Set central widget to the group box.

Parameters
widwidget being added to the group box

References widget().

◆ sizeHint()

QSize QtxGroupBox::sizeHint ( ) const
virtual

Get recommended size for the widget.

Returns
recommended size for the widget

References expandTo().

◆ titleSize()

QSize QtxGroupBox::titleSize ( ) const
private

Get the group box title size.

Returns
title size

◆ updateTitle()

void QtxGroupBox::updateTitle ( )
private

Update the group box title.

References myContainer, setInsideMargin(), and titleSize().

◆ widget()

QWidget * QtxGroupBox::widget ( ) const

Get central widget (or first found one).

Returns
widget

Member Data Documentation

◆ myContainer

QWidget* QtxGroupBox::myContainer
private

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