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;