3 #include <QDoubleSpinBox>
16 #define cmp_or_log(l, c, r) \
18 : (out << " FAILED: " #l " " #c " " #r " " << VAROUT(l) << ", " << VAROUT(r) << '\n', \
21 return cmp_or_log(desc.min.x, <=, desc.max.x) &&
33 const QObject* stateChangeReceiver,
34 const char* stateChangeSlot)
37 QWidget* widget =
new QWidget;
38 widget->setToolTip(QString::fromStdString(desc.toolTip));
39 QHBoxLayout* l =
new QHBoxLayout;
40 l->setContentsMargins(0, 0, 0, 0);
45 Eigen::Vector3i decimals =
fromIce(desc.decimals);
46 Eigen::Vector3i steps =
fromIce(desc.steps);
47 for (
int i = 0; i < 3; ++i)
49 QDoubleSpinBox* e =
new QDoubleSpinBox;
51 e->setMinimum(
min(i));
52 e->setMaximum(
max(i));
53 e->setDecimals(decimals(i));
54 e->setSingleStep((
max(i) -
min(i)) / steps(i));
56 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));
72 QWidgetT* parent =
static_cast<QWidget*
>(widget->parent());
75 static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(0)->widget())->
value()),
77 static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(1)->widget())->
value()),
79 static_cast<QDoubleSpinBox*
>(parent->layout()->itemAt(2)->widget())->
value())};