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

Implements a property widget for WPropDouble. More...

#include <WPropertyDoubleWidget.h>

+ Inheritance diagram for WPropertyDoubleWidget:
+ Collaboration diagram for WPropertyDoubleWidget:

Public Slots

void sliderChanged (int value)
 Called whenever the slider changes. More...
 
void editChanged ()
 Called whenever the edit field changes. More...
 
void textEdited (const QString &text)
 Called when the text in m_edit changes. More...
 
void minMaxUpdated ()
 Called whenever the interval edit changes. More...
 

Public Member Functions

 WPropertyDoubleWidget (WPropDouble property, QGridLayout *propertyGrid, QWidget *parent=0)
 Constructor. More...
 
virtual ~WPropertyDoubleWidget ()
 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...
 
int toSliderValue (double value)
 Converts a given value to a slider value between m_min and m_max. More...
 
double fromSliderValue (int perc)
 Converts the given slider value to the real double value using m_min and m_max. More...
 
- Protected Member Functions inherited from WPropertyWidget
virtual bool event (QEvent *event)
 Custom event dispatcher. More...
 

Protected Attributes

WPropDouble m_integralProperty
 The property represented by this widget. More...
 
QSlider m_slider
 The slider allowing modification of the integer value. More...
 
QLineEdit m_edit
 The edit field showing the value of the slider. More...
 
QHBoxLayout m_layout
 Layout used to position the label and the checkbox. More...
 
QVBoxLayout m_vLayout
 Layout used to combine the property widgets with the WQtIntervalEdit. More...
 
double m_min
 The current minimum value. More...
 
double m_max
 The current maximum value. 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...
 
WQtIntervalEdit< double, double > m_intervalEdit
 The edit for the interval. 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...
 

Static Protected Attributes

static int SliderResolution = 10000
 Resolution of the slider. 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 43 of file WPropertyDoubleWidget.h.

Constructor & Destructor Documentation

◆ WPropertyDoubleWidget()

WPropertyDoubleWidget::WPropertyDoubleWidget ( WPropDouble  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 44 of file WPropertyDoubleWidget.cpp.

References editChanged(), WQtGui::getSettings(), m_asText, m_edit, m_infoLayout, WPropertyWidget::m_informationWidgets, m_intervalEdit, m_layout, WPropertyWidget::m_parameterWidgets, m_slider, m_vLayout, minMaxUpdated(), sliderChanged(), textEdited(), and update().

+ Here is the call graph for this function:

◆ ~WPropertyDoubleWidget()

WPropertyDoubleWidget::~WPropertyDoubleWidget ( )
virtual

Destructor.

Definition at line 98 of file WPropertyDoubleWidget.cpp.

Member Function Documentation

◆ editChanged

void WPropertyDoubleWidget::editChanged ( )
slot

Called whenever the edit field changes.

Definition at line 165 of file WPropertyDoubleWidget.cpp.

References WPropertyWidget::invalidate(), m_edit, m_integralProperty, m_slider, and toSliderValue().

Referenced by WPropertyDoubleWidget().

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

◆ fromSliderValue()

double WPropertyDoubleWidget::fromSliderValue ( int  perc)
protected

Converts the given slider value to the real double value using m_min and m_max.

Parameters
percthe percentage.
Returns
the real double value.

Definition at line 148 of file WPropertyDoubleWidget.cpp.

References m_max, m_min, and SliderResolution.

Referenced by sliderChanged().

+ Here is the caller graph for this function:

◆ minMaxUpdated

void WPropertyDoubleWidget::minMaxUpdated ( )
slot

Called whenever the interval edit changes.

Definition at line 199 of file WPropertyDoubleWidget.cpp.

References WQtIntervalEdit< DataType, DisplayType >::getMax(), WQtIntervalEdit< DataType, DisplayType >::getMin(), m_integralProperty, m_intervalEdit, m_max, m_min, m_slider, and toSliderValue().

Referenced by WPropertyDoubleWidget().

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

◆ sliderChanged

void WPropertyDoubleWidget::sliderChanged ( int  value)
slot

Called whenever the slider changes.

Parameters
valuethe new value

Definition at line 153 of file WPropertyDoubleWidget.cpp.

References fromSliderValue(), WPropertyWidget::invalidate(), m_edit, m_integralProperty, m_slider, and toSliderValue().

Referenced by WPropertyDoubleWidget().

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

◆ textEdited

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

Called when the text in m_edit changes.

Parameters
text

Definition at line 183 of file WPropertyDoubleWidget.cpp.

References WPropertyWidget::invalidate(), and m_integralProperty.

Referenced by WPropertyDoubleWidget().

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

◆ toSliderValue()

int WPropertyDoubleWidget::toSliderValue ( double  value)
protected

Converts a given value to a slider value between m_min and m_max.

Parameters
valuethe value.
Returns
the percentage.

Definition at line 142 of file WPropertyDoubleWidget.cpp.

References m_max, m_min, and SliderResolution.

Referenced by editChanged(), minMaxUpdated(), sliderChanged(), and update().

+ Here is the caller graph for this function:

◆ update()

void WPropertyDoubleWidget::update ( )
protectedvirtual

Member Data Documentation

◆ m_asText

WScaleLabel WPropertyDoubleWidget::m_asText
protected

Used to show the property as text.

Definition at line 123 of file WPropertyDoubleWidget.h.

Referenced by update(), and WPropertyDoubleWidget().

◆ m_edit

QLineEdit WPropertyDoubleWidget::m_edit
protected

The edit field showing the value of the slider.

Definition at line 80 of file WPropertyDoubleWidget.h.

Referenced by editChanged(), sliderChanged(), update(), and WPropertyDoubleWidget().

◆ m_infoLayout

QHBoxLayout WPropertyDoubleWidget::m_infoLayout
protected

The layout used for the pure output (information properties)

Definition at line 128 of file WPropertyDoubleWidget.h.

Referenced by WPropertyDoubleWidget().

◆ m_integralProperty

WPropDouble WPropertyDoubleWidget::m_integralProperty
protected

The property represented by this widget.

Definition at line 70 of file WPropertyDoubleWidget.h.

Referenced by editChanged(), minMaxUpdated(), sliderChanged(), textEdited(), and update().

◆ m_intervalEdit

WQtIntervalEdit< double, double > WPropertyDoubleWidget::m_intervalEdit
protected

The edit for the interval.

Definition at line 133 of file WPropertyDoubleWidget.h.

Referenced by minMaxUpdated(), update(), and WPropertyDoubleWidget().

◆ m_layout

QHBoxLayout WPropertyDoubleWidget::m_layout
protected

Layout used to position the label and the checkbox.

Definition at line 85 of file WPropertyDoubleWidget.h.

Referenced by WPropertyDoubleWidget().

◆ m_max

double WPropertyDoubleWidget::m_max
protected

The current maximum value.

Definition at line 118 of file WPropertyDoubleWidget.h.

Referenced by fromSliderValue(), minMaxUpdated(), toSliderValue(), and update().

◆ m_min

double WPropertyDoubleWidget::m_min
protected

The current minimum value.

Definition at line 113 of file WPropertyDoubleWidget.h.

Referenced by fromSliderValue(), minMaxUpdated(), toSliderValue(), and update().

◆ m_slider

QSlider WPropertyDoubleWidget::m_slider
protected

The slider allowing modification of the integer value.

Definition at line 75 of file WPropertyDoubleWidget.h.

Referenced by editChanged(), minMaxUpdated(), sliderChanged(), update(), and WPropertyDoubleWidget().

◆ m_vLayout

QVBoxLayout WPropertyDoubleWidget::m_vLayout
protected

Layout used to combine the property widgets with the WQtIntervalEdit.

Definition at line 90 of file WPropertyDoubleWidget.h.

Referenced by WPropertyDoubleWidget().

◆ SliderResolution

int WPropertyDoubleWidget::SliderResolution = 10000
staticprotected

Resolution of the slider.

Definition at line 138 of file WPropertyDoubleWidget.h.

Referenced by fromSliderValue(), toSliderValue(), and update().


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