itom 2.2.0
|
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>
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< ValueProxyPrivate > | d_ptr |
Properties | |
double | value |
double | proxyValue |
Private Member Functions | |
Q_DECLARE_PRIVATE (ValueProxy) | |
Q_DISABLE_COPY (ValueProxy) |
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().
void ValueProxy::updateProxyValue | ( | ) | [protected] |
Utilities function for subclasses. Can be called to update the value/proxyValue from the proxyValue/value.
double ValueProxy::proxyValue [read, write] |
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 [read, write] |
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.