34 #ifndef CXDOUBLEWIDGETS_H_ 35 #define CXDOUBLEWIDGETS_H_ 37 #include "cxResourceWidgetsExport.h" 42 #include <QDoubleSpinBox> 44 #include <QGridLayout> 72 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(valueChangedSlot(
int)));
78 setRange(0, mRange.resolution());
79 setSingleStep(mRange.step());
83 int v_i = (val - mRange.min()) / mRange.step();
88 double v_d = mRange.step() * (double) value() + mRange.min();
93 setTickInterval(interval / mRange.step());
97 void doubleValueChanged(
double value);
100 void valueChangedSlot(
int val)
102 emit doubleValueChanged(getDoubleValue());
120 virtual QSize sizeHint()
const;
121 virtual QSize minimumSizeHint()
const;
125 double newVal = this->text().toDouble(&ok);
132 this->setText(QString::number(val,
'g', 4));
157 void enableSpinBox();
158 void enableInfiniteSlider();
160 void addToOwnLayout();
161 void addToGridLayout(QGridLayout* gridLayout = 0,
int row = 0);
162 void build(QGridLayout* gridLayout = 0,
int row = 0);
164 void showLabel(
bool on);
167 void textEditedSlot();
168 void doubleValueChanged(
double val);
169 void intValueChanged(
int val);
170 void infiniteSliderMouseMoved(QPointF delta);
173 virtual void prePaintEvent();
177 void enableAll(
bool);
181 QDoubleSpinBox* mSpinBox;
double getDoubleValue() const
void setDoubleValue(double val)
boost::shared_ptr< SpinBoxAndSliderGroupWidget > SpinBoxAndSliderGroupWidgetPtr
Utility class for describing a bounded numeric range.
boost::shared_ptr< SpinBoxAndDialGroupWidget > SpinBoxAndDialGroupWidgetPtr
double getDoubleValue(double defVal=0.0) const
void setDoubleRange(const DoubleRange &range)
DoubleSlider(QWidget *parent=0)
Custom widget for display of double-valued data.
boost::shared_ptr< class DoublePropertyBase > DoublePropertyBasePtr
A QLineEdit specialized to deal with double data.
void setDoubleValue(double val)
void setDoubleTickInterval(double interval)
DoubleLineEdit(QWidget *parent=0)
Namespace for all CustusX production code.