OpenWalnut  1.5.0dev
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
WQtPropertyGroupWidget Class Reference

Container widget to contain a number of properties for the module context in the control panel. More...

#include <WQtPropertyGroupWidget.h>

+ Inheritance diagram for WQtPropertyGroupWidget:
+ Collaboration diagram for WQtPropertyGroupWidget:

Signals

void hideSignal (bool hide)
 A Signal which gets emitted whenever the widget should be hidden. More...
 

Public Member Functions

 WQtPropertyGroupWidget (WPropertyGroupBase::SPtr group, size_t depth=0, QWidget *parent=0)
 Creates new widget for a property group. More...
 
virtual ~WQtPropertyGroupWidget ()
 destructor More...
 
bool isEmpty () const
 True if there are no widgets inside. More...
 
QPushButton * addPushButton (QString label)
 helper function to add a generic button More...
 
void addProp (WPropertyBase::SPtr property)
 Adds a new property widget to the PropertyGroup. More...
 
void addGroup (WQtPropertyGroupWidget *widget, bool asScrollArea=false)
 Adds an widget containing another property group to this widget. More...
 
void addGroup (WPropertyGroupBase::SPtr prop)
 Add the given prop group to this widget. More...
 
void addSpacer ()
 helper function to add a spacer at the end More...
 
QString getName ()
 The property group name. More...
 
void setName (QString name)
 Sets the name of this widget. More...
 
WPropertyGroupBase::SPtr getPropertyGroup ()
 Get the managed group of this widget. More...
 

Static Public Member Functions

static QWidget * createPropertyGroupBox (QWidget *widget, bool asScrollArea=false, QWidget *parent=NULL, const QString &title="", int nestingLevel=0)
 This function creates the fancy box around your specified group widget. More...
 
static QWidget * createPropertyGroupBox (WPropertyGroupBase::SPtr group, const QString &title="", size_t depth=0, QWidget *parent=0)
 Create a property widget using the given group. More...
 
static QWidget * createPropertyGroupBox (WPropertyGroupBase::SPtr group, bool asScrollArea, const QString &title="", size_t depth=0, QWidget *parent=0)
 Create a property widget using the given group. More...
 
static WQtPropertyGroupWidgetcreatePropertyGroupWidget (WPropertyGroupBase::SPtr group, const QString &title="", size_t depth=0, QWidget *parent=0)
 Create a property widget using the given group. More...
 

Protected Member Functions

virtual void propertyChangeNotifier ()
 Callback for WPropertyBase::getChangeCondition. More...
 
virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Private Types

typedef std::map< WPropertyBase::SPtr, QWidget * > PropertyWidgets
 The map between a prop and the widget handling it. More...
 

Private Attributes

QString m_name
 The name used for this widget. More...
 
QGridLayout * m_controlLayout
 Layout used for each "widget combination". More...
 
QVBoxLayout * m_pageLayout
 Layout used for the whole widget. More...
 
unsigned int m_numberOfWidgets
 The number of widgets inside this one. More...
 
WPropertyGroupBase::SPtr m_group
 The property group handled here. More...
 
PropertyWidgets m_propWidgets
 The map if property pointer to actual property widget. More...
 
boost::signals2::connection m_connection
 The connection for propertyChangeNotifier(). More...
 
size_t m_nestingDepth
 The depth of this group. More...
 

Detailed Description

Container widget to contain a number of properties for the module context in the control panel.

Definition at line 61 of file WQtPropertyGroupWidget.h.

Member Typedef Documentation

◆ PropertyWidgets

typedef std::map< WPropertyBase::SPtr, QWidget* > WQtPropertyGroupWidget::PropertyWidgets
private

The map between a prop and the widget handling it.

Definition at line 252 of file WQtPropertyGroupWidget.h.

Constructor & Destructor Documentation

◆ WQtPropertyGroupWidget()

WQtPropertyGroupWidget::WQtPropertyGroupWidget ( WPropertyGroupBase::SPtr  group,
size_t  depth = 0,
QWidget *  parent = 0 
)

Creates new widget for a property group.

Use this constructor to provide automatic hidden-flag management.

Parameters
groupThe group
depththe nesting depth of this group, it usually is parents depth + 1.
parentThe widget managing this widget

Definition at line 49 of file WQtPropertyGroupWidget.cpp.

References addProp(), addSpacer(), m_connection, m_controlLayout, m_group, m_pageLayout, propertyChangeNotifier(), and setName().

Referenced by addGroup(), and createPropertyGroupWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~WQtPropertyGroupWidget()

WQtPropertyGroupWidget::~WQtPropertyGroupWidget ( )
virtual

destructor

Definition at line 104 of file WQtPropertyGroupWidget.cpp.

References m_connection.

Member Function Documentation

◆ addGroup() [1/2]

void WQtPropertyGroupWidget::addGroup ( WPropertyGroupBase::SPtr  prop)

Add the given prop group to this widget.

Parameters
propthe property group

Definition at line 172 of file WQtPropertyGroupWidget.cpp.

References addGroup(), m_nestingDepth, and WQtPropertyGroupWidget().

+ Here is the call graph for this function:

◆ addGroup() [2/2]

void WQtPropertyGroupWidget::addGroup ( WQtPropertyGroupWidget widget,
bool  asScrollArea = false 
)

Adds an widget containing another property group to this widget.

It encloses it with a GroupBox.

Parameters
widgetthe widget
asScrollAreatrue if the group should be embedded into a scroll area

Definition at line 378 of file WQtPropertyGroupWidget.cpp.

References createPropertyGroupBox(), getPropertyGroup(), m_controlLayout, and m_propWidgets.

Referenced by addGroup(), and addProp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addProp()

void WQtPropertyGroupWidget::addProp ( WPropertyBase::SPtr  property)

Adds a new property widget to the PropertyGroup.

Returns NULL if property not supported. This also supports groups.

Parameters
propertythe property to add.

Definition at line 156 of file WQtPropertyGroupWidget.cpp.

References addGroup(), WPropertyWidget::construct(), m_controlLayout, and m_propWidgets.

Referenced by event(), and WQtPropertyGroupWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPushButton()

QPushButton* WQtPropertyGroupWidget::addPushButton ( QString  label)

helper function to add a generic button

Parameters
labelText on the push button
Returns
the push button instance

◆ addSpacer()

void WQtPropertyGroupWidget::addSpacer ( )

helper function to add a spacer at the end

Definition at line 390 of file WQtPropertyGroupWidget.cpp.

References m_pageLayout.

Referenced by WQtPropertyGroupWidget().

+ Here is the caller graph for this function:

◆ createPropertyGroupBox() [1/3]

QWidget * WQtPropertyGroupWidget::createPropertyGroupBox ( QWidget *  widget,
bool  asScrollArea = false,
QWidget *  parent = NULL,
const QString &  title = "",
int  nestingLevel = 0 
)
static

This function creates the fancy box around your specified group widget.

Parameters
widgetthe widget to put into the box
asScrollAreaif true, the widget is embedded into a scroll area
parentthe parent widget
titlethe title to use for the box. If empty, the property group name is used.
nestingLevelthe nesting level (defines color)
Returns
the box widget

Definition at line 177 of file WQtPropertyGroupWidget.cpp.

References WQtGui::getMainWindow(), getName(), hideSignal(), m_nestingDepth, and WScaleToolButton::setText().

Referenced by addGroup(), WQtDockWidget::addTitleProperty(), WQtControlPanel::buildPropTab(), createPropertyGroupBox(), WQtNetworkItem::mouseDoubleClickEvent(), WUIQtPropertyGroupWidget::realizeImpl(), WQtDataModuleInput::WQtDataModuleInput(), and WQtColormapper::WQtTextureListItem::WQtTextureListItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPropertyGroupBox() [2/3]

QWidget * WQtPropertyGroupWidget::createPropertyGroupBox ( WPropertyGroupBase::SPtr  group,
bool  asScrollArea,
const QString &  title = "",
size_t  depth = 0,
QWidget *  parent = 0 
)
static

Create a property widget using the given group.

Parameters
groupthe property group to represent
titlethe title of the widget
depththe nesting depth
parentthe parent widget
asScrollAreaif true, add a scroll area around the group
Returns
the widget.

Definition at line 342 of file WQtPropertyGroupWidget.cpp.

References createPropertyGroupBox(), createPropertyGroupWidget(), and getName().

+ Here is the call graph for this function:

◆ createPropertyGroupBox() [3/3]

QWidget * WQtPropertyGroupWidget::createPropertyGroupBox ( WPropertyGroupBase::SPtr  group,
const QString &  title = "",
size_t  depth = 0,
QWidget *  parent = 0 
)
static

Create a property widget using the given group.

Parameters
groupthe property group to represent
titlethe title of the widget
depththe nesting depth
parentthe parent widget
Returns
the widget.

Definition at line 358 of file WQtPropertyGroupWidget.cpp.

References createPropertyGroupBox().

+ Here is the call graph for this function:

◆ createPropertyGroupWidget()

WQtPropertyGroupWidget * WQtPropertyGroupWidget::createPropertyGroupWidget ( WPropertyGroupBase::SPtr  group,
const QString &  title = "",
size_t  depth = 0,
QWidget *  parent = 0 
)
static

Create a property widget using the given group.

The difference to createPropertyGroupBox is that this call only creates the plain WQtPropertyGroupWidget which can be embedded somewhere else.

Parameters
groupthe property group to represent
titlethe title of the widget
depththe nesting depth
parentthe parent widget
Returns
the widget.

Definition at line 363 of file WQtPropertyGroupWidget.cpp.

References setName(), and WQtPropertyGroupWidget().

Referenced by WQtDockWidget::addTitleProperty(), and createPropertyGroupBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ event()

bool WQtPropertyGroupWidget::event ( QEvent event)
protectedvirtual

Custom event dispatcher.

Gets called by QT's Event system every time an event got sent to this widget. This event handler processes property change events.

Note
QT Doc says: use event() for custom events.
Parameters
eventthe event that got transmitted.
Returns
true if the event got handled properly.

Definition at line 115 of file WQtPropertyGroupWidget.cpp.

References addProp(), hideSignal(), m_group, and m_propWidgets.

+ Here is the call graph for this function:

◆ getName()

QString WQtPropertyGroupWidget::getName ( )

The property group name.

Returns
the group name

Definition at line 396 of file WQtPropertyGroupWidget.cpp.

References m_name.

Referenced by WQtControlPanel::addTabWidgetContent(), and createPropertyGroupBox().

+ Here is the caller graph for this function:

◆ getPropertyGroup()

WPropertyGroupBase::SPtr WQtPropertyGroupWidget::getPropertyGroup ( )

Get the managed group of this widget.

Returns
the group

Definition at line 411 of file WQtPropertyGroupWidget.cpp.

References m_group.

Referenced by addGroup().

+ Here is the caller graph for this function:

◆ hideSignal

void WQtPropertyGroupWidget::hideSignal ( bool  hide)
signal

A Signal which gets emitted whenever the widget should be hidden.

This is a useful signal for containers which embed this group.

Parameters
hideif true, the widget should be hidden.

Referenced by createPropertyGroupBox(), and event().

+ Here is the caller graph for this function:

◆ isEmpty()

bool WQtPropertyGroupWidget::isEmpty ( ) const

True if there are no widgets inside.

Returns
true if number of widgets is 0.

Definition at line 406 of file WQtPropertyGroupWidget.cpp.

References m_propWidgets.

Referenced by WQtControlPanel::addTabWidgetContent().

+ Here is the caller graph for this function:

◆ propertyChangeNotifier()

void WQtPropertyGroupWidget::propertyChangeNotifier ( )
protectedvirtual

Callback for WPropertyBase::getChangeCondition.

It emits an event to ensure all updates are done in gui thread.

Definition at line 110 of file WQtPropertyGroupWidget.cpp.

Referenced by WQtPropertyGroupWidget().

+ Here is the caller graph for this function:

◆ setName()

void WQtPropertyGroupWidget::setName ( QString  name)

Sets the name of this widget.

Parameters
namethe name.

Definition at line 401 of file WQtPropertyGroupWidget.cpp.

References m_name.

Referenced by WQtControlPanel::buildPropTab(), createPropertyGroupWidget(), and WQtPropertyGroupWidget().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_connection

boost::signals2::connection WQtPropertyGroupWidget::m_connection
private

The connection for propertyChangeNotifier().

Definition at line 262 of file WQtPropertyGroupWidget.h.

Referenced by WQtPropertyGroupWidget(), and ~WQtPropertyGroupWidget().

◆ m_controlLayout

QGridLayout* WQtPropertyGroupWidget::m_controlLayout
private

Layout used for each "widget combination".

Definition at line 232 of file WQtPropertyGroupWidget.h.

Referenced by addGroup(), addProp(), and WQtPropertyGroupWidget().

◆ m_group

WPropertyGroupBase::SPtr WQtPropertyGroupWidget::m_group
private

The property group handled here.

Definition at line 247 of file WQtPropertyGroupWidget.h.

Referenced by event(), getPropertyGroup(), and WQtPropertyGroupWidget().

◆ m_name

QString WQtPropertyGroupWidget::m_name
private

The name used for this widget.

Definition at line 227 of file WQtPropertyGroupWidget.h.

Referenced by getName(), and setName().

◆ m_nestingDepth

size_t WQtPropertyGroupWidget::m_nestingDepth
private

The depth of this group.

Definition at line 267 of file WQtPropertyGroupWidget.h.

Referenced by addGroup(), and createPropertyGroupBox().

◆ m_numberOfWidgets

unsigned int WQtPropertyGroupWidget::m_numberOfWidgets
private

The number of widgets inside this one.

Definition at line 242 of file WQtPropertyGroupWidget.h.

◆ m_pageLayout

QVBoxLayout* WQtPropertyGroupWidget::m_pageLayout
private

Layout used for the whole widget.

Definition at line 237 of file WQtPropertyGroupWidget.h.

Referenced by addSpacer(), and WQtPropertyGroupWidget().

◆ m_propWidgets

PropertyWidgets WQtPropertyGroupWidget::m_propWidgets
private

The map if property pointer to actual property widget.

Definition at line 257 of file WQtPropertyGroupWidget.h.

Referenced by addGroup(), addProp(), event(), and isEmpty().


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