4 #include <QDoubleSpinBox>
15 #define cmp_or_log(l,c,r) \
18 out << " FAILED: " #l " " #c " " #r " " \
19 << VAROUT(l) << ", " << VAROUT(r) << '\n',\
36 const QObject* stateChangeReceiver,
const char* stateChangeSlot)
39 QWidget* widget =
new QWidget;
40 widget->setToolTip(QString::fromStdString(desc.toolTip));
41 QHBoxLayout* l =
new QHBoxLayout;
42 l->setContentsMargins(0, 0, 0, 0);
47 Eigen::Vector3i decimals =
fromIce(desc.decimals);
48 Eigen::Vector3i steps =
fromIce(desc.steps);
49 for (
int i = 0; i < 3; ++i)
51 QDoubleSpinBox* e =
new QDoubleSpinBox;
53 e->setMinimum(
min(i));
54 e->setMaximum(
max(i));
55 e->setDecimals(decimals(i));
56 e->setSingleStep((
max(i) -
min(i)) / steps(i));
57 QObject::connect(e, SIGNAL(valueChanged(
double)), stateChangeReceiver, stateChangeSlot);
64 static_cast<QDoubleSpinBox*
>(widget->layout()->itemAt(0)->widget())->setValue(
value(0));
65 static_cast<QDoubleSpinBox*
>(widget->layout()->itemAt(1)->widget())->setValue(
value(1));
66 static_cast<QDoubleSpinBox*
>(widget->layout()->itemAt(2)->widget())->setValue(
value(2));
71 QWidgetT* parent =
static_cast<QWidget*
>(widget->parent());
74 static_cast<float>(
static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(0)->widget())->
value()),
75 static_cast<float>(
static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(1)->widget())->
value()),
76 static_cast<float>(
static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(2)->widget())->
value())