Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

SuperSpinBox Class Reference

Inherits QSpinBox and extends it to support double-precision floating-point numbers. More...

#include <superspinbox.h>

List of all members.

Public Slots

virtual void setValue (double value)
virtual void stepUp ()
virtual void stepDown ()

Signals

void valueChanged (double value)
void valueChanged (const QString &valueText)

Public Member Functions

 SuperSpinBox (QWidget *parent=NULL, const char *name=NULL)
 SuperSpinBox (double minValue, double maxValue, double step=DEFAULT_STEP_VALUE, QWidget *parent=NULL, const char *name=NULL)
double value () const
double minValue () const
double maxValue () const
double lineStep () const
void setMinValue (double min)
void setMaxValue (double max)
void setLineStep (double step)

Protected Member Functions

virtual int mapTextToValue (bool *ok)
virtual QString mapValueToText (int)
virtual void valueChange ()
virtual void rangeChange ()

Protected Attributes

double d_value
double d_minValue
double d_maxValue
double d_lineStep

Private Member Functions

void sharedInit ()

Private Attributes

QDoubleValidator * validator


Detailed Description

Inherits QSpinBox and extends it to support double-precision floating-point numbers.

Benefits of this method of this approach: the widget looks and feels exactly like the normal integer spin box.

Note: Unlike QSpinBox, this reimplemention does NOT calculate the minimum width for the widget. Instead it will expdand to fill the entrie allocated area.


Constructor & Destructor Documentation

SuperSpinBox::SuperSpinBox QWidget *  parent = NULL,
const char *  name = NULL
 

Constructor.

This will initialize the double's min, max and line step values to their defaults of 0.0, 99.0 and 1.0 (respectively).

SuperSpinBox::SuperSpinBox double  minValue,
double  maxValue,
double  step = DEFAULT_STEP_VALUE,
QWidget *  parent = NULL,
const char *  name = NULL
 

Constructor.

This constructor takes the double's min, max and line step values as parameters, instead of using defaults.


Member Function Documentation

double SuperSpinBox::lineStep  )  const [inline]
 

int SuperSpinBox::mapTextToValue bool *  ok  )  [protected, virtual]
 

Reimplemented as to get the lastest DOUBLE value from the editor widget.

QString SuperSpinBox::mapValueToText int   )  [protected, virtual]
 

Map the value of the double value to its actual string representation.

double SuperSpinBox::maxValue  )  const [inline]
 

double SuperSpinBox::minValue  )  const [inline]
 

void SuperSpinBox::rangeChange  )  [protected, virtual]
 

Reimplemented as to update the editor's validator and to enable/disable the up and down arrow buttons.

void SuperSpinBox::setLineStep double  step  ) 
 

Reimplemented as to update the double's line step (increment/decrement) value.

void SuperSpinBox::setMaxValue double  max  ) 
 

Reimplemented as to update the double max value and the editor's validator.

void SuperSpinBox::setMinValue double  min  ) 
 

Reimplemented as to update the double min value and the editor's validator.

void SuperSpinBox::setValue double  value  )  [virtual, slot]
 

Reimplemented as to update the double value and to update the editor widget.

void SuperSpinBox::sharedInit  )  [private]
 

This method is used by the constructors to perform tasks that are common to all of them.

void SuperSpinBox::stepDown  )  [virtual, slot]
 

Decrement the double value by d_lineStep and update the editor widget.

void SuperSpinBox::stepUp  )  [virtual, slot]
 

Increment the double value by d_lineStep and update the editor widget.

double SuperSpinBox::value  )  const [inline]
 

void SuperSpinBox::valueChange  )  [protected, virtual]
 

This looks after things that need to be updated when the value is changed.

It will look after bounds checks and enabling / disabling the up and down buttons, update the text display and emit the SuperSpinBox::valueChanged() signals.

Note: This does not call the parent's valueChange, as we don't want to emit the integer-based signals.

void SuperSpinBox::valueChanged const QString &  valueText  )  [signal]
 

void SuperSpinBox::valueChanged double  value  )  [signal]
 


Member Data Documentation

double SuperSpinBox::d_lineStep [protected]
 

double SuperSpinBox::d_maxValue [protected]
 

double SuperSpinBox::d_minValue [protected]
 

double SuperSpinBox::d_value [protected]
 

QDoubleValidator* SuperSpinBox::validator [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Feb 27 12:01:41 2004 for Glitch by doxygen 1.3.2