itom  4.1.0
ValueProxy Class Referenceabstract

Base class for value proxies. Value proxy allows to decouple the displayed value from the values accessed within the program. For example, one may want to display Fahrenheit while still working with Celsius. More...

#include <valueProxy.h>

Inheritance diagram for ValueProxy:

Public Types

typedef QObject Superclass
 

Public Slots

void setValue (double newValue)
 
void setProxyValue (double newProxyValue)
 

Signals

void valueChanged (double)
 
void proxyValueChanged (double)
 
void proxyAboutToBeModified ()
 
void proxyModified ()
 

Public Member Functions

 ValueProxy (QObject *parent=0)
 
virtual double proxyValueFromValue (double value) const =0
 
virtual double valueFromProxyValue (double proxyValue) const =0
 
double value () const
 
virtual double proxyValue () const
 

Protected Member Functions

void updateProxyValue ()
 
void updateValue ()
 

Protected Attributes

QScopedPointer< ValueProxyPrivated_ptr
 

Properties

double value
 
double proxyValue
 

Private Member Functions

 Q_DECLARE_PRIVATE (ValueProxy)
 
 Q_DISABLE_COPY (ValueProxy)
 

Detailed Description

Base class for value proxies. Value proxy allows to decouple the displayed value from the values accessed within the program. For example, one may want to display Fahrenheit while still working with Celsius.

A ValueProxy can be used by connecting signal/slots to the value and proxyValue properties or by using directly the valueFromProxyValue and proxyValueFromValue functions.

Subclasses should reimplement the function proxyValueFromValue() and valueFromProxyValue().

See also
LinearValueProxy

Member Function Documentation

void ValueProxy::updateProxyValue ( )
protected

Utilities function for subclasses. Can be called to update the value/proxyValue from the proxyValue/value.

Property Documentation

double ValueProxy::proxyValue
readwrite

The proxy value holds the value transformed. If the value proxy is considered as a function, then the proxy value is the result of this function applied to value. The proxy value is updated if the value is changed.

double ValueProxy::value
readwrite

The value holds the current value. If the value proxy is considered as a function, then this function applied to the value is the proxy value. The value is updated if the proxy value is changed.


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