16 #include <QFontMetrics>
27 QWidget(parent), mData(data)
29 this->setToolTip(data->getHelp());
36 QHBoxLayout* aLayout =
new QHBoxLayout(retval);
37 aLayout->setMargin(0);
38 aLayout->addWidget(
new QLabel(data->getDisplayName(), retval), 0);
39 retval->addSmallControlsForIndex(
"x",
"X", 0, aLayout);
40 retval->addSmallControlsForIndex(
"y",
"Y", 1, aLayout);
41 retval->addSmallControlsForIndex(
"z",
"Z", 2, aLayout);
50 QVBoxLayout* aLayout =
new QVBoxLayout(retval);
51 aLayout->setMargin(0);
52 retval->addSliderControlsForIndex(
"x",
"X", 0, aLayout);
53 retval->addSliderControlsForIndex(
"y",
"Y", 1, aLayout);
54 retval->addSliderControlsForIndex(
"z",
"Z", 2, aLayout);
61 mWidgets[dim]->setVisible(visible);
67 void Vector3DWidget::addSliderControlsForIndex(QString name, QString help,
int index, QBoxLayout* layout)
71 layout->addWidget(mWidgets[index]);
73 mDoubleAdapter[index] = component;
79 void Vector3DWidget::addSmallControlsForIndex(QString name, QString help,
int index, QBoxLayout* layout)
83 ScalarInteractionWidget* widget =
new ScalarInteractionWidget(
this, component);
84 widget->enableSpinBox();
86 mWidgets[index] = widget;
87 layout->addWidget(mWidgets[index], 1);
89 mDoubleAdapter[index] = component;