13 #ifndef CXDOUBLEWIDGETS_H_ 14 #define CXDOUBLEWIDGETS_H_ 16 #include "cxResourceWidgetsExport.h" 21 #include <QDoubleSpinBox> 23 #include <QGridLayout> 51 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(valueChangedSlot(
int)));
57 setRange(0, mRange.resolution());
58 setSingleStep(mRange.step());
62 int v_i = (val - mRange.min()) / mRange.step();
67 double v_d = mRange.step() * (double) value() + mRange.min();
72 setTickInterval(interval / mRange.step());
76 void doubleValueChanged(
double value);
79 void valueChangedSlot(
int val)
81 emit doubleValueChanged(getDoubleValue());
99 virtual QSize sizeHint()
const;
100 virtual QSize minimumSizeHint()
const;
104 double newVal = this->text().toDouble(&ok);
111 this->setText(QString::number(val,
'g', 4));
136 void enableSpinBox();
137 void enableInfiniteSlider();
139 void addToOwnLayout();
140 void addToGridLayout(QGridLayout* gridLayout = 0,
int row = 0);
141 void build(QGridLayout* gridLayout = 0,
int row = 0);
143 void showLabel(
bool on);
146 void textEditedSlot();
147 void doubleValueChanged(
double val);
148 void intValueChanged(
int val);
149 void infiniteSliderMouseMoved(QPointF delta);
152 virtual void prePaintEvent();
156 void enableAll(
bool);
160 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.