32 #ifndef CXDOUBLESPANSLIDER_H_ 33 #define CXDOUBLESPANSLIDER_H_ 35 #include "cxResourceWidgetsExport.h" 39 #include "qxtspanslider.h" 61 connect(
this, SIGNAL(spanChanged(
int,
int)),
this, SLOT(spanChangedSlot(
int,
int)));
67 this->setRange(0, mRange.resolution());
68 this->setSingleStep(mRange.step());
76 int lower_i = (lower-mRange.min())/mRange.step();
77 int upper_i = (upper-mRange.min())/mRange.step();
78 this->setSpan(lower_i, upper_i);
82 int v_i = (val-mRange.min())/mRange.step();
83 this->setLowerValue(v_i);
87 double v_d = mRange.step()*(double)(this->lowerValue()) + mRange.min();
92 int v_i = (val-mRange.min())/mRange.step();
93 this->setUpperValue(v_i);
97 double v_d = mRange.step()*(double)(this->upperValue()) + mRange.min();
102 this->setTickInterval(interval/mRange.step());
106 void doubleSpanChanged(
double lower,
double upper);
109 void spanChangedSlot(
int lower,
int upper)
111 emit doubleSpanChanged(getDoubleLowerValue(), getDoubleUpperValue());
128 void addToGridLayout(QGridLayout* gridLayout,
int row);
130 void setDecimals(
int decimals);
131 std::pair<double,double> getValue()
const;
132 bool setValue(
double lower,
double upper);
135 void valueChanged(
double lower,
double upper);
138 void doubleSpanChangedSlot(
double lower,
double upper);
139 void textEditedSlot();
144 void init(QGridLayout *gridLayout,
int row);
145 void updateGuiRange();
147 QDoubleSpinBox* mLowerEdit;
148 QDoubleSpinBox* mUpperEdit;
void setDoubleSpan(double lower, double upper)
double getDoubleLowerValue() const
double getDoubleUpperValue() const
Utility class for describing a bounded numeric range.
void setDoubleTickInterval(double interval)
boost::shared_ptr< DoublePairPropertyBase > DoublePairPropertyBasePtr
Custom widget for display of double-valued data.Use the double-named methods instead of qslider's int...
virtual ~DoubleSpanSlider()
DoubleRange getDoubleRange() const
DoubleSpanSlider(QWidget *parent=0)
void setDoubleRange(const DoubleRange &range)
void setDoubleUpperValue(double val)
void setDoubleLowerValue(double val)
Namespace for all CustusX production code.