OpenWalnut  1.5.0dev
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WPropertyWidget Class Referenceabstract

Class building the base for all widgets representing properties. More...

#include <WPropertyWidget.h>

+ Inheritance diagram for WPropertyWidget:
+ Collaboration diagram for WPropertyWidget:

Public Member Functions

 WPropertyWidget (std::shared_ptr< WPropertyBase > property, QGridLayout *propertyGrid, QWidget *parent=0)
 Constructor. More...
 
virtual ~WPropertyWidget ()
 Destructor. More...
 
std::shared_ptr< WPropertyBasegetProperty ()
 Returns the handled property. More...
 
virtual void invalidate (bool invalid=true)
 This method marks this widget as invalid. More...
 
virtual std::string getTooltip () const
 Gets the tooltip that should be used for this widget. More...
 
QWidget * getParameterWidgets ()
 Returns the parameter widget for this property. More...
 
QWidget * getInformationWidgets ()
 Returns the info widget for this property. More...
 
virtual void requestUpdate ()
 Request an update of the property widget. More...
 
void forceInformationMode (bool force=true)
 Force the widget to use the information widgets. More...
 

Static Public Member Functions

static WPropertyWidgetconstruct (WPropertyBase::SPtr property, QGridLayout *propertyGrid=NULL, QWidget *parent=NULL)
 Constructs a proper widget for the specified property. More...
 

Protected Member Functions

virtual void update ()=0
 Called whenever the widget should update itself. More...
 
virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Protected Attributes

std::shared_ptr< WPropertyBasem_property
 The property handled by the widget. More...
 
QGridLayout * m_propertyGrid
 The grid used to layout label and widget. More...
 
WScaleLabel m_label
 The label used to name the property. More...
 
QWidget m_separator
 Separator after each property. More...
 
bool m_useLabel
 If set to true, the widgets uses the control layout to combine the widget with a label. More...
 
QWidget m_parameterWidgets
 The widget containing a layout and provides the edit widgets for the property. More...
 
QWidget m_informationWidgets
 The widget containing a layout and provides the widgets for showing information properties. More...
 
bool m_invalid
 Flag denoting whether the widget is set to an invalid value. More...
 
boost::signals2::connection m_connection
 The connection for propertyChangeNotifier(). More...
 
QColor m_sepCol
 The color to use for separators. More...
 
QColor m_labelCol
 The color to use for the property labels. More...
 
QColor m_propertyCol
 The color to use for property widgets. More...
 
QColor m_errorCol
 Color used for indicating errors. More...
 

Detailed Description

Class building the base for all widgets representing properties.

It simply contains the handled property object.

Definition at line 44 of file WPropertyWidget.h.

Constructor & Destructor Documentation

◆ WPropertyWidget()

WPropertyWidget::WPropertyWidget ( std::shared_ptr< WPropertyBase property,
QGridLayout *  propertyGrid,
QWidget *  parent = 0 
)

Constructor.

Creates a new widget appropriate for the specified property.

Parameters
propertythe property to handle
parentthe parent widget.
propertyGridthe grid used to layout the labels and property widgets

Definition at line 50 of file WPropertyWidget.cpp.

References WScaleLabel::addAdditionalWidth(), getTooltip(), m_connection, m_errorCol, m_informationWidgets, m_label, m_labelCol, m_parameterWidgets, m_property, m_propertyCol, m_propertyGrid, m_separator, m_sepCol, m_useLabel, requestUpdate(), and WScaleLabel::setText().

+ Here is the call graph for this function:

◆ ~WPropertyWidget()

WPropertyWidget::~WPropertyWidget ( )
virtual

Destructor.

Definition at line 133 of file WPropertyWidget.cpp.

References m_connection.

Member Function Documentation

◆ construct()

WPropertyWidget * WPropertyWidget::construct ( WPropertyBase::SPtr  property,
QGridLayout *  propertyGrid = NULL,
QWidget *  parent = NULL 
)
static

Constructs a proper widget for the specified property.

If the widget type is not supported, NULL is returned.

Parameters
propertythe property to create the widget for
propertyGridgrid to provide to he widget
parentparent of the widget
Returns
widget

Definition at line 215 of file WPropertyWidget.cpp.

References WLogger::addLogMessage(), and WLogger::getLogger().

Referenced by WQtPropertyGroupWidget::addProp(), and WPropertyStructWidget::WPropertyStructWidget().

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

◆ event()

bool WPropertyWidget::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 155 of file WPropertyWidget.cpp.

References m_label, m_property, m_separator, and update().

Referenced by WPropertyColorWidget::dragEnterEvent(), WPropertyFilenameWidget::dragEnterEvent(), WPropertyColorWidget::dropEvent(), and WPropertyFilenameWidget::dropEvent().

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

◆ forceInformationMode()

void WPropertyWidget::forceInformationMode ( bool  force = true)

Force the widget to use the information widgets.

Parameters
forcetrue to force

Definition at line 139 of file WPropertyWidget.cpp.

References m_property.

Referenced by WQtRoiTreeItem::createWidget(), WQtBranchTreeItem::WQtBranchTreeItem(), and WQtColormapper::WQtTextureListItem::WQtTextureListItem().

+ Here is the caller graph for this function:

◆ getInformationWidgets()

QWidget * WPropertyWidget::getInformationWidgets ( )

Returns the info widget for this property.

Returns
the widget.

Definition at line 210 of file WPropertyWidget.cpp.

References m_informationWidgets.

◆ getParameterWidgets()

QWidget * WPropertyWidget::getParameterWidgets ( )

Returns the parameter widget for this property.

Returns
the widget

Definition at line 205 of file WPropertyWidget.cpp.

References m_parameterWidgets.

◆ getProperty()

std::shared_ptr< WPropertyBase > WPropertyWidget::getProperty ( )

Returns the handled property.

Returns
the property

Definition at line 179 of file WPropertyWidget.cpp.

References m_property.

◆ getTooltip()

std::string WPropertyWidget::getTooltip ( ) const
virtual

Gets the tooltip that should be used for this widget.

Returns
the tooltip.

Definition at line 170 of file WPropertyWidget.cpp.

References m_invalid, and m_property.

Referenced by invalidate(), and WPropertyWidget().

+ Here is the caller graph for this function:

◆ invalidate()

void WPropertyWidget::invalidate ( bool  invalid = true)
virtual

◆ requestUpdate()

void WPropertyWidget::requestUpdate ( )
virtual

Request an update of the property widget.

Can be called from any thread.

Definition at line 150 of file WPropertyWidget.cpp.

Referenced by WPropertyWidget().

+ Here is the caller graph for this function:

◆ update()

virtual void WPropertyWidget::update ( )
protectedpure virtual

Member Data Documentation

◆ m_connection

boost::signals2::connection WPropertyWidget::m_connection
protected

The connection for propertyChangeNotifier().

Definition at line 180 of file WPropertyWidget.h.

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

◆ m_errorCol

QColor WPropertyWidget::m_errorCol
protected

Color used for indicating errors.

Definition at line 200 of file WPropertyWidget.h.

Referenced by invalidate(), and WPropertyWidget().

◆ m_informationWidgets

QWidget WPropertyWidget::m_informationWidgets
protected

◆ m_invalid

bool WPropertyWidget::m_invalid
protected

Flag denoting whether the widget is set to an invalid value.

Definition at line 164 of file WPropertyWidget.h.

Referenced by getTooltip(), and invalidate().

◆ m_label

WScaleLabel WPropertyWidget::m_label
protected

The label used to name the property.

Definition at line 139 of file WPropertyWidget.h.

Referenced by event(), invalidate(), and WPropertyWidget().

◆ m_labelCol

QColor WPropertyWidget::m_labelCol
protected

The color to use for the property labels.

Definition at line 190 of file WPropertyWidget.h.

Referenced by invalidate(), and WPropertyWidget().

◆ m_parameterWidgets

QWidget WPropertyWidget::m_parameterWidgets
protected

◆ m_property

std::shared_ptr< WPropertyBase > WPropertyWidget::m_property
protected

The property handled by the widget.

Definition at line 129 of file WPropertyWidget.h.

Referenced by event(), forceInformationMode(), getProperty(), getTooltip(), WPropertySelectionWidget::WPropertySelectionWidget(), and WPropertyWidget().

◆ m_propertyCol

QColor WPropertyWidget::m_propertyCol
protected

The color to use for property widgets.

Definition at line 195 of file WPropertyWidget.h.

Referenced by WPropertyWidget().

◆ m_propertyGrid

QGridLayout* WPropertyWidget::m_propertyGrid
protected

The grid used to layout label and widget.

Definition at line 134 of file WPropertyWidget.h.

Referenced by WPropertyWidget().

◆ m_separator

QWidget WPropertyWidget::m_separator
protected

Separator after each property.

Definition at line 144 of file WPropertyWidget.h.

Referenced by event(), and WPropertyWidget().

◆ m_sepCol

QColor WPropertyWidget::m_sepCol
protected

The color to use for separators.

Definition at line 185 of file WPropertyWidget.h.

Referenced by WPropertyWidget().

◆ m_useLabel

bool WPropertyWidget::m_useLabel
protected

If set to true, the widgets uses the control layout to combine the widget with a label.

Definition at line 149 of file WPropertyWidget.h.

Referenced by invalidate(), and WPropertyWidget().


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