11 #ifndef CXDOUBLESPANSLIDER_H_ 12 #define CXDOUBLESPANSLIDER_H_ 14 #include "cxResourceWidgetsExport.h" 18 #include "qxtspanslider.h" 40 connect(
this, SIGNAL(spanChanged(
int,
int)),
this, SLOT(spanChangedSlot(
int,
int)));
46 this->setRange(0, mRange.resolution());
47 this->setSingleStep(mRange.step());
55 int lower_i = (lower-mRange.min())/mRange.step();
56 int upper_i = (upper-mRange.min())/mRange.step();
57 this->setSpan(lower_i, upper_i);
61 int v_i = (val-mRange.min())/mRange.step();
62 this->setLowerValue(v_i);
66 double v_d = mRange.step()*(double)(this->lowerValue()) + mRange.min();
71 int v_i = (val-mRange.min())/mRange.step();
72 this->setUpperValue(v_i);
76 double v_d = mRange.step()*(double)(this->upperValue()) + mRange.min();
81 this->setTickInterval(interval/mRange.step());
85 void doubleSpanChanged(
double lower,
double upper);
88 void spanChangedSlot(
int lower,
int upper)
90 emit doubleSpanChanged(getDoubleLowerValue(), getDoubleUpperValue());
107 void addToGridLayout(QGridLayout* gridLayout,
int row);
109 void setDecimals(
int decimals);
110 std::pair<double,double> getValue()
const;
111 bool setValue(
double lower,
double upper);
114 void valueChanged(
double lower,
double upper);
117 void doubleSpanChangedSlot(
double lower,
double upper);
118 void textEditedSlot();
123 void init(QGridLayout *gridLayout,
int row);
124 void updateGuiRange();
126 QDoubleSpinBox* mLowerEdit;
127 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.