OpenWalnut  1.5.0dev
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
WPropertyPositionWidget Class Reference

Implements a property widget for WPropDouble. More...

#include <WPropertyPositionWidget.h>

+ Inheritance diagram for WPropertyPositionWidget:
+ Collaboration diagram for WPropertyPositionWidget:

Public Slots

void editChanged ()
 Called whenever the edit field changes. More...
 
void textEdited (const QString &text)
 Called when the text in m_edit changes. More...
 

Public Member Functions

 WPropertyPositionWidget (WPropPosition property, QGridLayout *propertyGrid, QWidget *parent=0)
 Constructor. More...
 
virtual ~WPropertyPositionWidget ()
 Destructor. More...
 
- Public Member Functions inherited from WPropertyWidget
 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...
 

Protected Member Functions

virtual void update ()
 Called whenever the widget should update. More...
 
void setPropertyFromWidgets (bool validateOnly=false)
 Updates the property using the edit X Y and Z widgets. More...
 
- Protected Member Functions inherited from WPropertyWidget
virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Protected Attributes

WPropPosition m_posProperty
 The integer property represented by this widget. More...
 
QLineEdit m_editX
 The edit field showing the value of the slider. More...
 
QLineEdit m_editY
 The edit field showing the value of the slider. More...
 
QLineEdit m_editZ
 The edit field showing the value of the slider. More...
 
QHBoxLayout m_layout
 Layout used to position the label and the widgets. More...
 
WScaleLabel m_asText
 Used to show the property as text. More...
 
QHBoxLayout m_infoLayout
 The layout used for the pure output (information properties) More...
 
- Protected Attributes inherited from WPropertyWidget
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...
 

Private Member Functions

std::string toString (const WPosition &value)
 Helper function converting a position into a nice formatted string. More...
 
std::string toString (double value)
 Helper function converting a double into a nice formatted string. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from WPropertyWidget
static WPropertyWidgetconstruct (WPropertyBase::SPtr property, QGridLayout *propertyGrid=NULL, QWidget *parent=NULL)
 Constructs a proper widget for the specified property. More...
 

Detailed Description

Implements a property widget for WPropDouble.

Definition at line 41 of file WPropertyPositionWidget.h.

Constructor & Destructor Documentation

◆ WPropertyPositionWidget()

WPropertyPositionWidget::WPropertyPositionWidget ( WPropPosition  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 35 of file WPropertyPositionWidget.cpp.

References editChanged(), m_asText, m_editX, m_editY, m_editZ, m_infoLayout, WPropertyWidget::m_informationWidgets, m_layout, WPropertyWidget::m_parameterWidgets, textEdited(), and update().

+ Here is the call graph for this function:

◆ ~WPropertyPositionWidget()

WPropertyPositionWidget::~WPropertyPositionWidget ( )
virtual

Destructor.

Definition at line 83 of file WPropertyPositionWidget.cpp.

Member Function Documentation

◆ editChanged

void WPropertyPositionWidget::editChanged ( )
slot

Called whenever the edit field changes.

Definition at line 116 of file WPropertyPositionWidget.cpp.

References setPropertyFromWidgets().

Referenced by WPropertyPositionWidget().

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

◆ setPropertyFromWidgets()

void WPropertyPositionWidget::setPropertyFromWidgets ( bool  validateOnly = false)
protected

Updates the property using the edit X Y and Z widgets.

Parameters
validateOnlytrue if the prop should not really be set. Just validated.

Definition at line 126 of file WPropertyPositionWidget.cpp.

References WPropertyWidget::invalidate(), m_editX, m_editY, m_editZ, and m_posProperty.

Referenced by editChanged(), and textEdited().

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

◆ textEdited

void WPropertyPositionWidget::textEdited ( const QString &  text)
slot

Called when the text in m_edit changes.

Parameters
text

Definition at line 121 of file WPropertyPositionWidget.cpp.

References setPropertyFromWidgets().

Referenced by WPropertyPositionWidget().

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

◆ toString() [1/2]

std::string WPropertyPositionWidget::toString ( const WPosition value)
private

Helper function converting a position into a nice formatted string.

Parameters
valuethe value to convert
Returns
a string containing the position in a nicely formatted way.

Definition at line 88 of file WPropertyPositionWidget.cpp.

Referenced by update().

+ Here is the caller graph for this function:

◆ toString() [2/2]

std::string WPropertyPositionWidget::toString ( double  value)
private

Helper function converting a double into a nice formatted string.

Parameters
valuethe value to convert
Returns
a string containing the double in a nicely formatted way.

Definition at line 97 of file WPropertyPositionWidget.cpp.

◆ update()

void WPropertyPositionWidget::update ( )
protectedvirtual

Called whenever the widget should update.

Implements WPropertyWidget.

Definition at line 105 of file WPropertyPositionWidget.cpp.

References m_asText, m_editX, m_editY, m_editZ, m_posProperty, WScaleLabel::setText(), and toString().

Referenced by WPropertyPositionWidget().

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

Member Data Documentation

◆ m_asText

WScaleLabel WPropertyPositionWidget::m_asText
protected

Used to show the property as text.

Definition at line 93 of file WPropertyPositionWidget.h.

Referenced by update(), and WPropertyPositionWidget().

◆ m_editX

QLineEdit WPropertyPositionWidget::m_editX
protected

The edit field showing the value of the slider.

Definition at line 73 of file WPropertyPositionWidget.h.

Referenced by setPropertyFromWidgets(), update(), and WPropertyPositionWidget().

◆ m_editY

QLineEdit WPropertyPositionWidget::m_editY
protected

The edit field showing the value of the slider.

Definition at line 78 of file WPropertyPositionWidget.h.

Referenced by setPropertyFromWidgets(), update(), and WPropertyPositionWidget().

◆ m_editZ

QLineEdit WPropertyPositionWidget::m_editZ
protected

The edit field showing the value of the slider.

Definition at line 83 of file WPropertyPositionWidget.h.

Referenced by setPropertyFromWidgets(), update(), and WPropertyPositionWidget().

◆ m_infoLayout

QHBoxLayout WPropertyPositionWidget::m_infoLayout
protected

The layout used for the pure output (information properties)

Definition at line 98 of file WPropertyPositionWidget.h.

Referenced by WPropertyPositionWidget().

◆ m_layout

QHBoxLayout WPropertyPositionWidget::m_layout
protected

Layout used to position the label and the widgets.

Definition at line 88 of file WPropertyPositionWidget.h.

Referenced by WPropertyPositionWidget().

◆ m_posProperty

WPropPosition WPropertyPositionWidget::m_posProperty
protected

The integer property represented by this widget.

Definition at line 68 of file WPropertyPositionWidget.h.

Referenced by setPropertyFromWidgets(), and update().


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