DoubleSpinBox Class Reference

A QDoubleSpinBox allowing to customize numbers display with respect to locale settings. More...

`#include <DoubleSpinBox.h>`

Inheritance diagram for DoubleSpinBox:

## Signals

void | activated (DoubleSpinBox *)
| Signal emitted when the spin box gains focus. More...
void | valueChanged (double d)

## Public Member Functions

int | decimals ()
| DoubleSpinBox (const char format= 'g', QWidget *parent=0)
| Constructor. More...
QString | prefix () const
void | setDecimals (int prec)
void | setFormat (const char format, int prec=1)
void | setMaximum (double max)
void | setMinimum (double min)
void | setPrefix (const QString &prefix)
void | setRange (double min, double max)
void | setSingleStep (double val)
bool | setValue (double val)
QString | textFromValue (double value) const
virtual QValidator::State | validate (QString &input, int &pos) const
double | value ()

## Protected Member Functions

void | focusInEvent (QFocusEvent *)
void | stepBy (int steps)
StepEnabled | stepEnabled () const

## Private Slots

void | interpretText ()

## Private Attributes

char | d_format
double | d_max_val
double | d_min_val
int | d_prec
QString | d_prefix
double | d_step
double | d_value

## Detailed Description

A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.

It allows the user to specify a custom display format.

## Constructor & Destructor Documentation

DoubleSpinBox::DoubleSpinBox | ( | const char | format = `'g'`,
|  | QWidget * | parent = `0`
| ) |  |

Constructor.

Parameters

  format | format used to display numbers: has the same meaning as in QLocale::toString ( double i, char f = 'g', int prec = 6 )
  parent | parent widget (only affects placement of the dialog)

References d_format, d_prec, d_value, and interpretText().

## Member Function Documentation

void DoubleSpinBox::activated | ( | DoubleSpinBox * |  | ) |

signal

Signal emitted when the spin box gains focus.

Referenced by focusInEvent().

int DoubleSpinBox::decimals | ( |  | ) |

inline

References d_prec.

void DoubleSpinBox::focusInEvent | ( | QFocusEvent * | e | ) |

protected

References activated().

void DoubleSpinBox::interpretText | ( |  | ) |

private slot

References MyParser::addGSLConstants(), d_prefix, d_value, MyParser::setLocale(), setValue(), textFromValue(), value(), and valueChanged().

Referenced by DoubleSpinBox(), and value().

QString DoubleSpinBox::prefix | ( |  | ) | const

References d_prefix.

Referenced by setPrefix().

void DoubleSpinBox::setDecimals | ( | int | prec | ) |

inline

References d_prec.

Referenced by AnovaDialog::AnovaDialog(), ExpDecayDialog::ExpDecayDialog(), FFTDialog::FFTDialog(), FilterDialog::FilterDialog(), FrequencyCountDialog::FrequencyCountDialog(), FunctionDialog::FunctionDialog(), GriddingDialog::GriddingDialog(), ImageProfilesTool::ImageProfilesTool(), ImageExportDialog::initAdvancedOptions(), FitDialog::initAdvancedPage(), Plot3DDialog::initAxesPage(), PlotDialog::initContourLinesPage(), FitDialog::initFitPage(), EnrichmentDialog::initFramePage(), Plot3DDialog::initGeneralPage(), EnrichmentDialog::initGeometryPage(), LineDialog::initGeometryTab(), PlotDialog::initLabelsPage(), ConfigDialog::initLayerGeometryPage(), PlotDialog::initLayerGeometryPage(), SurfaceDialog::initParametricSurfacePage(), PlotDialog::initPlotGeometryPage(), Plot3DDialog::initPointsOptionsStack(), Plot3DDialog::initScalesPage(), AxesDialog::initScalesPage(), ContourLinesEditor::insertLevel(), ColorMapEditor::insertLevel(), IntegrationDialog::IntegrationDialog(), InterpolationDialog::InterpolationDialog(), LayerDialog::LayerDialog(), PolynomFitDialog::PolynomFitDialog(), ColorMapEditor::setColorMap(), RangeLimitBox::setDecimals(), setFormat(), Plot3DDialog::showBarsTab(), FitDialog::showFitPage(), StudentTestDialog::StudentTestDialog(), SubtractDataDialog::SubtractDataDialog(), and ContourLinesEditor::updateContents().

void DoubleSpinBox::setFormat | ( | const char | format,
|  | int | prec = `1`
| ) |  |

inline

References d_format, and setDecimals().

Referenced by EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), PlotDialog::displayPlotCoordinates(), ImageExportDialog::initAdvancedOptions(), ConfigDialog::updateCanvasSize(), and LayerDialog::updateSizes().

void DoubleSpinBox::setMaximum | ( | double | max | ) |

References d_max_val.

Referenced by setRange(), and ColorMapEditor::updateUpperRangeLimit().

void DoubleSpinBox::setMinimum | ( | double | min | ) |

References d_min_val, and min.

Referenced by ErrDialog::ErrDialog(), FilterDialog::FilterDialog(), GriddingDialog::GriddingDialog(), ImageExportDialog::initAdvancedOptions(), Plot3DDialog::initAxesPage(), Plot3DDialog::initGridPage(), PlotDialog::initHistogramPage(), PlotDialog::initLayerGeometryPage(), PlotDialog::initLayerSpeedPage(), PlotDialog::initLinePage(), PlotDialog::initPiePage(), PlotDialog::initPlotGeometryPage(), ConfigDialog::initPlots3DPage(), Plot3DDialog::initPointsOptionsStack(), AxesDialog::initScalesPage(), IntDialog::IntDialog(), setRange(), Plot3DDialog::showBarsTab(), and ColorMapEditor::updateLowerRangeLimit().

void DoubleSpinBox::setPrefix | ( | const QString & | prefix | ) |

inline

References d_prefix, and prefix().

Referenced by ColorMapEditor::setColorMap().

void DoubleSpinBox::setRange | ( | double | min,
|  | double | max
| ) |  |

References setMaximum(), and setMinimum().

Referenced by StudentTestDialog::addConfidenceLevel(), AnovaDialog::AnovaDialog(), FitDialog::initAdvancedPage(), PlotDialog::initContourLinesPage(), ConfigDialog::initCurvesPage(), PlotDialog::initErrorsPage(), FitDialog::initFitPage(), EnrichmentDialog::initFramePage(), Plot3DDialog::initGeneralPage(), AxesDialog::initGridPage(), ConfigDialog::initGridPage(), PlotDialog::initLabelsPage(), ConfigDialog::initLayerGeometryPage(), PlotDialog::initPercentilePage(), PlotDialog::initPieGeometryPage(), PlotDialog::initPieLabelsPage(), PlotDialog::initSymbolsPage(), PlotDialog::initVectPage(), ContourLinesEditor::insertLevel(), ColorMapEditor::insertLevel(), LayerDialog::LayerDialog(), LineDialog::LineDialog(), ColorMapEditor::setColorMap(), StudentTestDialog::StudentTestDialog(), ContourLinesEditor::updateContents(), and ColorMapEditor::updateLowerRangeLimit().

void DoubleSpinBox::setSingleStep | ( | double | val | ) |

References d_max_val, and d_step.

Referenced by StudentTestDialog::addConfidenceLevel(), AnovaDialog::AnovaDialog(), EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), PlotDialog::displayPlotCoordinates(), ImageProfilesTool::ImageProfilesTool(), FitDialog::initAdvancedPage(), PlotDialog::initContourLinesPage(), ConfigDialog::initCurvesPage(), PlotDialog::initErrorsPage(), FitDialog::initFitPage(), EnrichmentDialog::initFramePage(), Plot3DDialog::initGeneralPage(), AxesDialog::initGridPage(), ConfigDialog::initGridPage(), PlotDialog::initLinePage(), PlotDialog::initPercentilePage(), PlotDialog::initPieGeometryPage(), PlotDialog::initPiePage(), PlotDialog::initSymbolsPage(), PlotDialog::initVectPage(), IntDialog::IntDialog(), LineDialog::LineDialog(), StudentTestDialog::StudentTestDialog(), ConfigDialog::updateCanvasSize(), AxesDialog::updateScale(), and LayerDialog::updateSizes().

bool DoubleSpinBox::setValue | ( | double | val | ) |

References d_max_val, d_min_val, d_value, and textFromValue().

Referenced by PlotDialog::acceptParams(), InterpolationDialog::activateCurve(), IntegrationDialog::activateCurve(), PolynomFitDialog::activateCurve(), ExpDecayDialog::activateCurve(), FitDialog::activateCurve(), FFTDialog::activateDataSet(), StudentTestDialog::addConfidenceLevel(), LayerDialog::adjustCanvasHeight(), ConfigDialog::adjustCanvasHeight(), LayerDialog::adjustCanvasWidth(), ConfigDialog::adjustCanvasWidth(), EnrichmentDialog::adjustHeight(), ImageExportDialog::adjustHeight(), PlotDialog::adjustLayerHeight(), PlotDialog::adjustLayerWidth(), PlotDialog::adjustPlotHeight(), PlotDialog::adjustPlotWidth(), EnrichmentDialog::adjustWidth(), ImageExportDialog::adjustWidth(), AnovaDialog::AnovaDialog(), ImageProfilesTool::append(), InterpolationDialog::changeDataRange(), IntegrationDialog::changeDataRange(), PolynomFitDialog::changeDataRange(), ExpDecayDialog::changeDataRange(), FitDialog::changeDataRange(), CreateBinMatrixDialog::CreateBinMatrixDialog(), LineDialog::displayCoordinates(), EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), PlotDialog::displayPlotCoordinates(), ErrDialog::ErrDialog(), ExpDecayDialog::ExpDecayDialog(), FilterDialog::FilterDialog(), ExpDecayDialog::fit(), FrequencyCountDialog::FrequencyCountDialog(), FunctionDialog::FunctionDialog(), GriddingDialog::GriddingDialog(), FunctionDialog::guessConstants(), ImageExportDialog::initAdvancedOptions(), FitDialog::initAdvancedPage(), ConfigDialog::initCurvesPage(), FitDialog::initFitPage(), SurfaceDialog::initFunctionPage(), AxesDialog::initGridPage(), ConfigDialog::initGridPage(), PlotDialog::initLinePage(), SurfaceDialog::initParametricSurfacePage(), ConfigDialog::initPlots3DPage(), Plot3DDialog::initPointsOptionsStack(), ContourLinesEditor::insertLevel(), ColorMapEditor::insertLevel(), IntDialog::IntDialog(), interpretText(), LineDialog::LineDialog(), GriddingDialog::loadDataFromTable(), MatrixSizeDialog::MatrixSizeDialog(), RangeLimitBox::RangeLimitBox(), PlotDialog::setActiveCurve(), PlotDialog::setActiveLayer(), ConfigDialog::setApplication(), PlotDialog::setAutomaticBinning(), ColorMapEditor::setColorMap(), FunctionDialog::setCurveToModify(), SurfaceDialog::setFunction(), LayerDialog::setLayerCanvasSize(), SurfaceDialog::setParametricSurface(), Plot3DDialog::setPlot(), FFTDialog::setTable(), EnrichmentDialog::setWidget(), Plot3DDialog::showBarsTab(), Plot3DDialog::showConesTab(), Plot3DDialog::showCrossHairTab(), FitDialog::showFitPage(), AxesDialog::showGridOptions(), ConfigDialog::showGridOptions(), ContourLinesEditor::showPenDialog(), Plot3DDialog::showPointsTab(), stepBy(), StudentTestDialog::StudentTestDialog(), LayerDialog::update(), ConfigDialog::updateCanvasSize(), ContourLinesEditor::updateContents(), PlotDialog::updateContourLevelsDisplay(), ColorMapEditor::updateLowerRangeLimit(), AxesDialog::updateScale(), LayerDialog::updateSizes(), Plot3DDialog::viewAxisOptions(), and Plot3DDialog::viewScaleLimits().

void DoubleSpinBox::stepBy | ( | int | steps | ) |

protected

References d_step, d_value, setValue(), and valueChanged().

QAbstractSpinBox::StepEnabled DoubleSpinBox::stepEnabled | ( |  | ) | const

protected

References d_max_val, d_min_val, and d_value.

QString DoubleSpinBox::textFromValue | ( | double | value | ) | const

References d_format, d_min_val, d_prec, and d_prefix.

Referenced by interpretText(), and setValue().

QValidator::State DoubleSpinBox::validate | ( | QString & | input,
|  | int & | pos
| ) |  | const

virtual

double DoubleSpinBox::value | ( |  | ) |

inline

References d_value, and interpretText().

Referenced by CreateBinMatrixDialog::accept(), IntDialog::accept(), GriddingDialog::accept(), FFTDialog::accept(), FitDialog::accept(), StudentTestDialog::acceptChiSquareTest(), FunctionDialog::acceptFunction(), SurfaceDialog::acceptFunction(), AnovaDialog::acceptNormalityTest(), FunctionDialog::acceptParametric(), SurfaceDialog::acceptParametricSurface(), PlotDialog::acceptParams(), FunctionDialog::acceptPolar(), StudentTestDialog::acceptStudentTest(), ErrDialog::add(), StudentTestDialog::addConfidenceLevel(), LayerDialog::adjustCanvasHeight(), ConfigDialog::adjustCanvasHeight(), LayerDialog::adjustCanvasWidth(), ConfigDialog::adjustCanvasWidth(), EnrichmentDialog::adjustHeight(), PlotDialog::adjustLayerHeight(), PlotDialog::adjustLayerWidth(), PlotDialog::adjustPlotHeight(), PlotDialog::adjustPlotWidth(), EnrichmentDialog::adjustWidth(), FrequencyCountDialog::apply(), MatrixSizeDialog::apply(), LineDialog::apply(), ConfigDialog::apply(), PlotDialog::applyCanvasSize(), AxesDialog::applyChangesToGrid(), PlotDialog::applyErrorBarFormatToCurve(), PlotDialog::applyLabelsFormatToItem(), PlotDialog::applyLineFormatToLayer(), PlotDialog::applyPercentileFormatToCurve(), PlotDialog::applySymbolsFormatToCurve(), PlotDialog::changePlotType(), StudentTestDialog::closeEvent(), AnovaDialog::closeEvent(), ImageExportDialog::closeEvent(), ImageExportDialog::customExportSize(), EnrichmentDialog::displayCoordinates(), FilterDialog::filter(), PolynomFitDialog::fit(), ExpDecayDialog::fit(), FitDialog::guessInitialValues(), ContourLinesEditor::insertLevel(), ColorMapEditor::insertLevel(), IntegrationDialog::integrateCurve(), SubtractDataDialog::interpolate(), InterpolationDialog::interpolate(), interpretText(), PlotDialog::pickErrorBarsColor(), GriddingDialog::preview(), ImageExportDialog::scaleFontsFactor(), LineDialog::setCoordinates(), EnrichmentDialog::setCoordinates(), LineDialog::setDefaultValues(), PlotDialog::setEquidistantLevels(), EnrichmentDialog::setFrameDefaultValues(), EnrichmentDialog::setFrameTo(), LayerDialog::setLayerCanvasSize(), FitDialog::showConfidenceLimits(), FitDialog::showPredictionLimits(), LayerDialog::update(), ImageProfilesTool::updateCursorPosition(), ImageProfilesTool::updateCursorWidth(), ConfigDialog::updateGrid(), ContourLinesEditor::updatePen(), Plot3DDialog::updatePlot(), AxesDialog::updatePlot(), FitDialog::updatePreview(), IntDialog::validInput(), and RangeLimitBox::value().

void DoubleSpinBox::valueChanged | ( | double | d | ) |

signal

Referenced by interpretText(), and stepBy().

## Member Data Documentation

char DoubleSpinBox::d_format

private

Referenced by DoubleSpinBox(), setFormat(), and textFromValue().

double DoubleSpinBox::d_max_val

private

Referenced by setMaximum(), setSingleStep(), setValue(), and stepEnabled().

double DoubleSpinBox::d_min_val

private

Referenced by setMinimum(), setValue(), stepEnabled(), and textFromValue().

int DoubleSpinBox::d_prec

private

Referenced by decimals(), DoubleSpinBox(), setDecimals(), and textFromValue().

QString DoubleSpinBox::d_prefix

private

Referenced by interpretText(), prefix(), setPrefix(), and textFromValue().

double DoubleSpinBox::d_step

private

Referenced by setSingleStep(), and stepBy().

double DoubleSpinBox::d_value

private

Referenced by DoubleSpinBox(), interpretText(), setValue(), stepBy(), stepEnabled(), and value().

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

- qtiplot/src/lib/include/DoubleSpinBox.h
- qtiplot/src/lib/src/DoubleSpinBox.cpp