7 #include "guiQt/editor/SParameters.hpp" 9 #include <fwCom/Signal.hxx> 10 #include <fwCom/Slots.hxx> 12 #include <fwDataTools/Color.hpp> 14 #include <fwGuiQt/container/QtContainer.hpp> 16 #include <fwServices/macros.hpp> 18 #include <fwTools/Object.hpp> 20 #include <boost/foreach.hpp> 21 #include <boost/tokenizer.hpp> 24 #include <QColorDialog> 26 #include <QFormLayout> 41 static const ::fwCom::Signals::SignalKeyType BOOLEAN_CHANGED_SIG =
"boolChanged";
42 static const ::fwCom::Signals::SignalKeyType COLOR_CHANGED_SIG =
"colorChanged";
43 static const ::fwCom::Signals::SignalKeyType DOUBLE_CHANGED_SIG =
"doubleChanged";
44 static const ::fwCom::Signals::SignalKeyType DOUBLE2_CHANGED_SIG =
"double2Changed";
45 static const ::fwCom::Signals::SignalKeyType DOUBLE3_CHANGED_SIG =
"double3Changed";
46 static const ::fwCom::Signals::SignalKeyType INTEGER_CHANGED_SIG =
"intChanged";
47 static const ::fwCom::Signals::SignalKeyType INTEGER2_CHANGED_SIG =
"int2Changed";
48 static const ::fwCom::Signals::SignalKeyType INTEGER3_CHANGED_SIG =
"int3Changed";
49 static const ::fwCom::Signals::SignalKeyType ENUM_CHANGED_SIG =
"enumChanged";
50 static const ::fwCom::Signals::SignalKeyType ENUM_INDEX_CHANGED_SIG =
"enumIndexChanged";
52 static const ::fwCom::Slots::SlotKeyType s_SET_BOOL_PARAMETER_SLOT =
"setBoolParameter";
53 static const ::fwCom::Slots::SlotKeyType s_SET_COLOR_PARAMETER_SLOT =
"setColorParameter";
54 static const ::fwCom::Slots::SlotKeyType s_SET_DOUBLE_PARAMETER_SLOT =
"setDoubleParameter";
55 static const ::fwCom::Slots::SlotKeyType s_SET_DOUBLE2_PARAMETER_SLOT =
"setDouble2Parameter";
56 static const ::fwCom::Slots::SlotKeyType s_SET_DOUBLE3_PARAMETER_SLOT =
"setDouble3Parameter";
57 static const ::fwCom::Slots::SlotKeyType s_SET_INT_PARAMETER_SLOT =
"setIntParameter";
58 static const ::fwCom::Slots::SlotKeyType s_SET_INT2_PARAMETER_SLOT =
"setInt2Parameter";
59 static const ::fwCom::Slots::SlotKeyType s_SET_INT3_PARAMETER_SLOT =
"setInt3Parameter";
60 static const ::fwCom::Slots::SlotKeyType s_SET_ENUM_PARAMETER_SLOT =
"setEnumParameter";
61 static const ::fwCom::Slots::SlotKeyType s_SET_INT_MIN_PARAMETER_SLOT =
"setIntMinParameter";
62 static const ::fwCom::Slots::SlotKeyType s_SET_INT_MAX_PARAMETER_SLOT =
"setIntMaxParameter";
63 static const ::fwCom::Slots::SlotKeyType s_SET_DOUBLE_MIN_PARAMETER_SLOT =
"setDoubleMinParameter";
64 static const ::fwCom::Slots::SlotKeyType s_SET_DOUBLE_MAX_PARAMETER_SLOT =
"setDoubleMaxParameter";
71 newSignal< BooleanChangedSignalType>(BOOLEAN_CHANGED_SIG);
72 newSignal< ColorChangedSignalType>(COLOR_CHANGED_SIG);
73 newSignal< DoubleChangedSignalType>(DOUBLE_CHANGED_SIG);
74 newSignal< Double2ChangedSignalType>(DOUBLE2_CHANGED_SIG);
75 newSignal< Double3ChangedSignalType>(DOUBLE3_CHANGED_SIG);
76 newSignal< IntegerChangedSignalType>(INTEGER_CHANGED_SIG);
77 newSignal< Integer2ChangedSignalType>(INTEGER2_CHANGED_SIG);
78 newSignal< Integer3ChangedSignalType>(INTEGER3_CHANGED_SIG);
79 newSignal< EnumChangedSignalType >(ENUM_CHANGED_SIG);
80 newSignal< EnumChangedIndexSignalType >(ENUM_INDEX_CHANGED_SIG);
82 newSlot(s_SET_BOOL_PARAMETER_SLOT, &SParameters::setBoolParameter,
this);
83 newSlot(s_SET_COLOR_PARAMETER_SLOT, &SParameters::setColorParameter,
this);
84 newSlot(s_SET_DOUBLE_PARAMETER_SLOT, &SParameters::setDoubleParameter,
this);
85 newSlot(s_SET_DOUBLE2_PARAMETER_SLOT, &SParameters::setDouble2Parameter,
this);
86 newSlot(s_SET_DOUBLE3_PARAMETER_SLOT, &SParameters::setDouble3Parameter,
this);
87 newSlot(s_SET_INT_PARAMETER_SLOT, &SParameters::setIntParameter,
this);
88 newSlot(s_SET_INT2_PARAMETER_SLOT, &SParameters::setInt2Parameter,
this);
89 newSlot(s_SET_INT3_PARAMETER_SLOT, &SParameters::setInt3Parameter,
this);
90 newSlot(s_SET_ENUM_PARAMETER_SLOT, &SParameters::setEnumParameter,
this);
91 newSlot(s_SET_INT_MIN_PARAMETER_SLOT, &SParameters::setIntMinParameter,
this);
92 newSlot(s_SET_INT_MAX_PARAMETER_SLOT, &SParameters::setIntMaxParameter,
this);
93 newSlot(s_SET_DOUBLE_MIN_PARAMETER_SLOT, &SParameters::setDoubleMinParameter,
this);
94 newSlot(s_SET_DOUBLE_MAX_PARAMETER_SLOT, &SParameters::setDoubleMaxParameter,
this);
116 auto qtContainer = ::fwGuiQt::container::QtContainer::dynamicCast(this->getContainer());
118 QGridLayout* layout =
new QGridLayout();
120 ::fwServices::IService::ConfigType config = this->
getConfigTree();
121 const ::fwServices::IService::ConfigType& parametersCfg = config.get_child(
"parameters");
125 this->blockSignals(
true);
128 BOOST_FOREACH(
const auto& param, parametersCfg.equal_range(
"param") )
130 const ::fwServices::IService::ConfigType& cfg = param.second;
132 const std::string name = cfg.get< std::string >(
"<xmlattr>.name");
133 const std::string key = cfg.get< std::string >(
"<xmlattr>.key");
134 const std::string type = cfg.get< std::string >(
"<xmlattr>.type");
135 const std::string defaultValue = cfg.get< std::string >(
"<xmlattr>.defaultValue");
137 layout->addWidget(
new QLabel(QString(name.c_str())), row, 0);
141 this->createBoolWidget(*layout, row, key, defaultValue);
143 else if(type ==
"color")
145 this->createColorWidget(*layout, row, key, defaultValue);
147 else if(type ==
"double" || type ==
"double2" || type ==
"double3")
149 const std::string widget = cfg.get< std::string >(
"<xmlattr>.widget",
"spin");
151 const double min = cfg.get<
double>(
"<xmlattr>.min", 0.);
152 const double max = cfg.get<
double>(
"<xmlattr>.max", 1.);
153 const double defaultValue = cfg.get<
double>(
"<xmlattr>.defaultValue", 0.5);
155 const int count = (type ==
"double3") ? 3 : (type ==
"double2" ? 2 : 1);
159 this->createDoubleWidget(*layout, row, key, defaultValue, min, max, count);
161 else if(widget ==
"slider")
164 SLM_ASSERT(
"Count > 1 is not supported with sliders", count == 1);
166 const std::uint8_t decimals = cfg.get< std::uint8_t >(
"<xmlattr>.decimals", 2);
167 this->createDoubleSliderWidget(*layout, row, key, defaultValue, min, max, decimals);
171 SLM_ERROR(
"Unknown widget type : '" + widget +
"' for " + name +
". Must be 'spin' or 'slider'.");
174 else if(type ==
"int" || type ==
"int2" || type ==
"int3")
176 const std::string widget = cfg.get< std::string >(
"<xmlattr>.widget",
"slider");
178 const int min = cfg.get<
int>(
"<xmlattr>.min", 0);
179 const int max = cfg.get<
int>(
"<xmlattr>.max", 100);
180 const int defaultValue = cfg.get<
int>(
"<xmlattr>.defaultValue", 50);
182 const int count = (type ==
"int3") ? 3 : (type ==
"int2" ? 2 : 1);
186 this->createIntegerSpinWidget(*layout, row, key, defaultValue, min, max, count);
188 else if(widget ==
"slider")
191 SLM_ASSERT(
"Count > 1 is not supported with sliders", count == 1);
193 this->createIntegerSliderWidget(*layout, row, key, defaultValue, min, max);
197 SLM_ERROR(
"Unknown widget type : '" + widget +
"' for " + name +
". Must be 'spin' or 'slider'.");
200 else if(type ==
"enum")
202 const std::string options = cfg.get<std::string>(
"<xmlattr>.values");
205 std::vector<std::string> values;
206 std::vector<std::string> data;
208 const ::boost::char_separator<char> sep(
", ;");
209 const ::boost::tokenizer< ::boost::char_separator<char> > tokens {options, sep};
211 for(
const auto& token : tokens)
214 const ::boost::char_separator<char> subsep(
"=");
215 const ::boost::tokenizer< ::boost::char_separator<char> > subtokens {token, subsep};
216 auto it = subtokens.begin();
218 if(it != subtokens.end() )
220 values.push_back(*it);
224 if(it != subtokens.end() )
231 data.push_back(values.back());
235 this->createEnumWidget(*layout, row, key, defaultValue, values, data);
241 qtContainer->setLayout(layout);
243 this->blockSignals(
false);
252 auto qtContainer = ::fwGuiQt::container::QtContainer::dynamicCast(this->getContainer());
253 QWidget* widget = qtContainer->getQtContainer();
255 ::fwServices::IService::ConfigType config = this->
getConfigTree();
256 const ::fwServices::IService::ConfigType& parametersCfg = config.get_child(
"parameters");
259 BOOST_FOREACH(
const auto& param, parametersCfg.equal_range(
"param") )
261 const ::fwServices::IService::ConfigType& cfg = param.second;
263 const std::string key = cfg.get< std::string >(
"<xmlattr>.key");
264 const std::string type = cfg.get< std::string >(
"<xmlattr>.type");
266 QWidget* child = widget->findChild<QWidget*>(QString::fromStdString(key));
271 const QCheckBox* box =
dynamic_cast<QCheckBox*
>(child);
272 SLM_ASSERT(
"Widget must be a QCheckBox", box);
274 const bool state = (box->checkState() == Qt::Checked);
278 this->signal<BooleanChangedSignalType>(BOOLEAN_CHANGED_SIG)->asyncEmit(state, key);
279 OSLM_DEBUG(
"[EMIT] " << BOOLEAN_CHANGED_SIG <<
"(" << (state ?
"true" :
"false") <<
", " << key <<
284 else if(type ==
"color")
286 const QColor colorQt = child->property(
"color").value<QColor>();
287 this->emitColorSignal(colorQt, key);
289 else if(type ==
"double" || type ==
"double2" || type ==
"double3")
291 this->emitDoubleSignal(child);
293 else if(type ==
"int" || type ==
"int2" || type ==
"int3")
295 this->emitIntegerSignal(child);
297 else if(type ==
"enum")
299 QComboBox* box = qobject_cast<QComboBox*>(child);
301 SLM_ASSERT(
"Widget must be a QComboBox", box);
303 const QString data = box->itemData(box->currentIndex()).toString();
307 this->signal<EnumChangedSignalType>(ENUM_CHANGED_SIG)->asyncEmit(data.toStdString(), key);
308 OSLM_DEBUG(
"[EMIT] " << ENUM_CHANGED_SIG <<
"(" << data.toStdString() <<
", " << key <<
")" );
309 this->signal<EnumChangedIndexSignalType>(ENUM_INDEX_CHANGED_SIG)->asyncEmit(box->currentIndex(),
311 OSLM_DEBUG(
"[EMIT] " << ENUM_INDEX_CHANGED_SIG <<
"(" << box->currentIndex() <<
", " << key <<
")");
327 void SParameters::onChangeEnum(
int value)
329 const QObject* sender = this->sender();
330 const QString key = sender->property(
"key").toString();
332 const QComboBox* box =
dynamic_cast<const QComboBox*
>(sender);
336 const QString data = box->itemData(value).toString();
340 this->signal<EnumChangedSignalType>(ENUM_CHANGED_SIG)->asyncEmit(data.toStdString(), key.toStdString());
341 OSLM_DEBUG(
"[EMIT] " << ENUM_CHANGED_SIG <<
"(" << data.toStdString() <<
", " << key.toStdString() <<
")" );
342 this->signal<EnumChangedIndexSignalType>(ENUM_INDEX_CHANGED_SIG)->asyncEmit(value, key.toStdString());
343 OSLM_DEBUG(
"[EMIT] " << ENUM_INDEX_CHANGED_SIG <<
"(" << value <<
", " << key.toStdString() <<
")" );
349 void SParameters::onChangeBoolean(
int value)
351 const QObject* sender = this->sender();
352 const QString key = sender->property(
"key").toString();
353 const bool checked = value == Qt::Checked;
357 this->signal<BooleanChangedSignalType>(BOOLEAN_CHANGED_SIG)->asyncEmit(checked, key.toStdString());
358 OSLM_DEBUG(
"[EMIT] " << BOOLEAN_CHANGED_SIG <<
"(" << (checked ?
"true" :
"false") <<
", " << key.toStdString()
365 void SParameters::onColorButton()
367 QObject* sender = this->sender();
370 auto qtContainer = ::fwGuiQt::container::QtContainer::dynamicCast( this->getContainer() );
371 QWidget*
const container = qtContainer->getQtContainer();
372 SLM_ASSERT(
"container not instanced", container);
374 const QColor oldColor = sender->property(
"color").value<QColor>();
375 const QColor colorQt = QColorDialog::getColor(oldColor, container);
376 if(colorQt.isValid())
378 const QString key = sender->property(
"key").toString();
380 QPushButton* colourButton =
dynamic_cast<QPushButton*
>(sender);
381 colourButton->setProperty(
"color", colorQt);
383 int iconSize = colourButton->style()->pixelMetric(QStyle::PM_LargeIconSize);
384 QPixmap pix(iconSize, iconSize);
387 colourButton->setIcon(QIcon(pix));
389 this->emitColorSignal(colorQt, key.toStdString());
395 void SParameters::onChangeInteger(
int )
397 QObject* sender = this->sender();
398 this->emitIntegerSignal(sender);
403 void SParameters::emitIntegerSignal(QObject* widget)
407 const QString key = widget->property(
"key").toString();
408 const int count = widget->property(
"count").toInt();
410 SLM_ASSERT(
"Invalid widgets count, must be <= 3", count <= 3);
412 const QSpinBox* spinbox =
dynamic_cast<const QSpinBox*
>(widget);
413 const QSlider* slider =
dynamic_cast<const QSlider*
>(widget);
414 SLM_ASSERT(
"Wrong widget type", spinbox || slider);
421 value = spinbox->value();
425 value = slider->value();
427 this->signal<IntegerChangedSignalType>(INTEGER_CHANGED_SIG)->asyncEmit(value, key.toStdString());
428 OSLM_DEBUG(
"[EMIT] " << INTEGER_CHANGED_SIG <<
"(" <<value <<
", " << key.toStdString() <<
")" );
437 const QSpinBox* spin1 = widget->property(
"widget#0").value< QSpinBox*>();
438 const QSpinBox* spin2 = widget->property(
"widget#1").value< QSpinBox*>();
440 value1 = spin1->value();
441 value2 = spin2->value();
445 const QSlider* spin1 = widget->property(
"widget#0").value< QSlider*>();
446 const QSlider* spin2 = widget->property(
"widget#1").value< QSlider*>();
448 value1 = spin1->value();
449 value2 = spin2->value();
454 this->signal<Integer2ChangedSignalType>(INTEGER2_CHANGED_SIG)->asyncEmit(value1, value2,
456 OSLM_DEBUG(
"[EMIT] " << INTEGER2_CHANGED_SIG <<
"(" << value1 <<
", " << value2 <<
", " <<
457 key.toStdString() <<
")" );
464 const QSpinBox* spin3 = widget->property(
"widget#2").value< QSpinBox*>();
465 value3 = spin3->value();
469 const QSlider* spin3 = widget->property(
"widget#2").value< QSlider*>();
470 value3 = spin3->value();
473 this->signal<Integer3ChangedSignalType>(INTEGER3_CHANGED_SIG)->asyncEmit(value1, value2, value3,
475 OSLM_DEBUG(
"[EMIT] " << INTEGER3_CHANGED_SIG <<
"(" << value1 <<
", " << value2 <<
", " << value3 <<
476 ", " << key.toStdString() <<
")" );
484 void SParameters::onChangeDouble(
double)
486 QObject* sender = this->sender();
487 this->emitDoubleSignal(sender);
492 void SParameters::emitDoubleSignal(QObject* widget)
496 const QString key = widget->property(
"key").toString();
497 const int count = widget->property(
"count").toInt();
499 QDoubleSpinBox* spinbox = qobject_cast<QDoubleSpinBox*>(widget);
500 QSlider* slider = qobject_cast<QSlider*>(widget);
504 const double value = this->getDoubleSliderValue(slider);
505 this->signal<DoubleChangedSignalType>(DOUBLE_CHANGED_SIG)->asyncEmit(value, key.toStdString());
506 OSLM_DEBUG(
"[EMIT] " << DOUBLE_CHANGED_SIG <<
"(" << value <<
", " << key.toStdString() <<
")" );
510 SLM_ASSERT(
"Invalid widgets count, must be <= 3", count <= 3);
514 this->signal<DoubleChangedSignalType>(DOUBLE_CHANGED_SIG)->asyncEmit(spinbox->value(),
516 OSLM_DEBUG(
"[EMIT] " << DOUBLE_CHANGED_SIG <<
"(" << spinbox->value() <<
", " 517 << key.toStdString() <<
")" );
522 const QDoubleSpinBox* spin1 = spinbox->property(
"widget#0").value< QDoubleSpinBox*>();
523 const QDoubleSpinBox* spin2 = spinbox->property(
"widget#1").value< QDoubleSpinBox*>();
525 const double value1 = spin1->value();
526 const double value2 = spin2->value();
530 this->signal<Double2ChangedSignalType>(DOUBLE2_CHANGED_SIG)->asyncEmit(value1, value2,
532 OSLM_DEBUG(
"[EMIT] " << DOUBLE2_CHANGED_SIG <<
"(" << value1 <<
", " << value2
533 <<
", " << key.toStdString() <<
")" );
538 const QDoubleSpinBox* spin3 = spinbox->property(
"widget#2").value< QDoubleSpinBox*>();
539 const double value3 = spin3->value();
541 this->signal<Double3ChangedSignalType>(DOUBLE3_CHANGED_SIG)->asyncEmit(value1, value2, value3,
543 OSLM_DEBUG(
"[EMIT] " << DOUBLE3_CHANGED_SIG <<
"(" << value1 <<
", " << value2
544 <<
", " << value3 <<
", " << key.toStdString() <<
")" );
553 void SParameters::onChangeDoubleSlider(
int)
555 QSlider* sender = qobject_cast<QSlider*>(this->sender());
556 this->emitDoubleSignal(sender);
561 void SParameters::onSliderMapped(QLabel* label, QSlider* slider)
563 label->setText(QString::number(slider->value()));
568 void SParameters::onSliderRangeMapped(QLabel* minLabel, QLabel* maxLabel, QSlider* slider)
570 const int min = slider->minimum();
571 const int max = slider->maximum();
573 minLabel->setText(QString::number(min));
574 maxLabel->setText(QString::number(max));
579 void SParameters::onDoubleSliderMapped(QLabel* label, QSlider* slider)
581 const double newValue = getDoubleSliderValue(slider);
582 const int decimals = slider->property(
"decimals").toInt();
584 label->setText(QString::number(newValue,
'f', decimals));
589 void SParameters::onDoubleSliderRangeMapped(QLabel* minLabel, QLabel* maxLabel, QSlider* slider)
591 const double min = slider->property(
"min").toDouble();
592 const double max = slider->property(
"max").toDouble();
593 const int decimals = slider->property(
"decimals").toInt();
595 minLabel->setText(QString::number(min,
'g', decimals));
596 maxLabel->setText(QString::number(max,
'g', decimals));
601 void SParameters::onResetBooleanMapped(QWidget* widget)
603 QCheckBox* checkbox = qobject_cast<QCheckBox*>(widget);
606 int value = checkbox->property(
"defaultValue").toInt();
607 checkbox->setCheckState(::Qt::CheckState(value));
609 const QString key = checkbox->property(
"key").toString();
612 this->signal<BooleanChangedSignalType>(BOOLEAN_CHANGED_SIG)->asyncEmit(value, key.toStdString());
613 OSLM_DEBUG(
"[EMIT] " << BOOLEAN_CHANGED_SIG <<
"(" << (value ?
"true" :
"false") <<
", " 614 << key.toStdString() <<
")" );
621 void SParameters::onResetColorMapped(QWidget* widget)
623 QPushButton* colourButton = qobject_cast<QPushButton*>(widget);
626 const QColor color = colourButton->property(
"defaultValue").value<QColor>();
627 const QString key = colourButton->property(
"key").toString();
629 int iconSize = colourButton->style()->pixelMetric(QStyle::PM_LargeIconSize);
630 QPixmap pix(iconSize, iconSize);
633 colourButton->setIcon(QIcon(pix));
634 colourButton->setProperty(
"color", color);
636 const std::array<std::uint8_t, 4> newColor = {{
static_cast<std::uint8_t
>(color.red()),
637 static_cast<std::uint8_t>(color.green()),
638 static_cast<std::uint8_t>(color.blue()),
639 static_cast<std::uint8_t>(color.alpha()) }};
642 this->signal<ColorChangedSignalType>(COLOR_CHANGED_SIG)->asyncEmit(newColor, key.toStdString());
643 OSLM_DEBUG(
"[EMIT] " << COLOR_CHANGED_SIG <<
"(" <<
int(newColor[0]) <<
", " 644 <<
int(newColor[1]) <<
", " <<
int(newColor[2]) <<
", " <<
int(newColor[3]) <<
", " 645 << key.toStdString() <<
")" );
652 void SParameters::onResetIntegerMapped(QWidget* widget)
654 QSlider* slider =
dynamic_cast<QSlider*
>(widget);
655 QSpinBox* spinbox =
dynamic_cast<QSpinBox*
>(widget);
656 this->blockSignals(
true);
659 const int value = slider->property(
"defaultValue").toInt();
660 slider->setValue(value);
664 const QString key = spinbox->property(
"key").toString();
665 const int value = spinbox->property(
"defaultValue").toInt();
666 const int count = spinbox->property(
"count").toInt();
667 SLM_ASSERT(
"Invalid widgets count, must be <= 3", count <= 3);
669 QSpinBox* spin1 = spinbox->property(
"widget#0").value< QSpinBox*>();
670 spin1->setValue(value);
674 QSpinBox* spin2 = spinbox->property(
"widget#1").value< QSpinBox*>();
675 spin2->setValue(value);
680 QSpinBox* spin3 = spinbox->property(
"widget#2").value< QSpinBox*>();
681 spin3->setValue(value);
685 this->blockSignals(
false);
686 this->emitIntegerSignal(widget);
691 void SParameters::onResetDoubleMapped(QWidget* widget)
693 QDoubleSpinBox* spinbox = qobject_cast<QDoubleSpinBox*>(widget);
694 QSlider* slider = qobject_cast<QSlider*>(widget);
696 this->blockSignals(
true);
699 const double value = slider->property(
"defaultValue").toDouble();
700 const double min = slider->property(
"min").toDouble();
701 const double max = slider->property(
"max").toDouble();
702 const double valueRange = max - min;
703 const int sliderVal = int(std::round(((value - min) / valueRange) *
double(slider->maximum())));
704 slider->setValue(sliderVal);
708 const QString key = spinbox->property(
"key").toString();
709 const double value = spinbox->property(
"defaultValue").toDouble();
710 const int count = spinbox->property(
"count").toInt();
711 SLM_ASSERT(
"Invalid widgets count, must be <= 3", count <= 3);
713 QDoubleSpinBox* spin1 = spinbox->property(
"widget#0").value< QDoubleSpinBox*>();
714 spin1->setValue(value);
718 QDoubleSpinBox* spin2 = spinbox->property(
"widget#1").value< QDoubleSpinBox*>();
719 spin2->setValue(value);
724 QDoubleSpinBox* spin3 = spinbox->property(
"widget#2").value< QDoubleSpinBox*>();
725 spin3->setValue(value);
729 this->blockSignals(
false);
730 this->emitDoubleSignal(widget);
736 QPushButton* SParameters::createResetButton()
738 QPushButton* resetButton =
new QPushButton(
"R" );
739 resetButton->setFocusPolicy(Qt::NoFocus);
740 resetButton->setToolTip(
"Reset to the default value.");
741 resetButton->setMaximumWidth(20);
748 void SParameters::createBoolWidget(QGridLayout& layout,
int row,
749 const std::string& key,
750 const std::string& defaultValue)
752 QCheckBox* checkbox =
new QCheckBox();
753 checkbox->setTristate(
false);
754 checkbox->setObjectName(QString::fromStdString(key));
756 if(defaultValue ==
"true")
758 checkbox->setCheckState(Qt::Checked);
761 checkbox->setProperty(
"key", QString(key.c_str()));
762 checkbox->setProperty(
"defaultValue", checkbox->checkState());
765 QPushButton* resetButton = this->createResetButton();
767 layout.addWidget(checkbox, row, 2);
768 layout.addWidget(resetButton, row, 5);
770 QObject::connect(checkbox, SIGNAL(stateChanged(
int)),
this, SLOT(onChangeBoolean(
int)));
773 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetBooleanMapped(checkbox); });
778 void SParameters::createColorWidget(QGridLayout& layout,
int row,
const std::string& key,
779 const std::string& defaultValue)
782 QPushButton* resetButton = this->createResetButton();
784 QPushButton* colourButton =
new QPushButton(
"Color");
785 colourButton->setObjectName(QString::fromStdString(key));
786 colourButton->setToolTip(tr(
"Selected color"));
787 colourButton->setMinimumSize(120, 35);
789 std::string colorStr =
"#ffffffff";
790 if(!defaultValue.empty())
792 std::uint8_t color[4];
796 colorStr = defaultValue;
799 std::uint8_t color[4];
802 const int iconSize = colourButton->style()->pixelMetric(QStyle::PM_LargeIconSize);
803 QPixmap pix(iconSize, iconSize);
805 QColor colorQt(color[0], color[1], color[2], color[3]);
808 colourButton->setIcon(QIcon(pix));
810 colourButton->setProperty(
"key", QString(key.c_str()));
811 colourButton->setProperty(
"defaultValue", colorQt);
812 colourButton->setProperty(
"color", colorQt);
814 layout.addWidget(colourButton, row, 2);
815 layout.addWidget(resetButton, row, 5);
817 QObject::connect(colourButton, SIGNAL(clicked()),
this, SLOT(onColorButton()));
820 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetColorMapped(colourButton); });
825 void SParameters::createDoubleWidget(QGridLayout& layout,
int row,
const std::string& key,
826 double defaultValue,
double min,
double max,
int count)
829 QPushButton* resetButton = this->createResetButton();
831 layout.addWidget(resetButton, row, 5);
833 QDoubleSpinBox* spinboxes[3];
836 for(
int i = 0; i < count; ++i)
838 QDoubleSpinBox* spinbox =
new QDoubleSpinBox();
839 spinboxes[i] = spinbox;
841 auto countDecimals = [](
double _num) ->
int 843 std::stringstream out;
845 const std::string s = out.str();
846 const std::string t = s.substr(s.find(
".") + 1);
847 return static_cast<int>(t.length());
850 spinbox->setDecimals(std::max( std::max(countDecimals(min), countDecimals(max)), 2));
852 spinbox->setRange(min, max);
855 spinbox->setSingleStep(std::abs(spinbox->maximum() - spinbox->minimum()) / 100.);
858 spinbox->setValue(defaultValue);
860 spinbox->setProperty(
"key", QString(key.c_str()));
861 spinbox->setProperty(
"count", count);
862 spinbox->setProperty(
"defaultValue", spinbox->value());
864 layout.addWidget(spinbox, row, 2 + i);
866 QObject::connect(spinbox, SIGNAL(valueChanged(
double)),
this, SLOT(onChangeDouble(
double)));
869 QDoubleSpinBox* spinbox = spinboxes[0];
870 spinbox->setObjectName(QString::fromStdString(key));
873 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetDoubleMapped(spinbox); });
876 for(
int i = 0; i < count; ++i)
878 for(
int j = 0; j < count; ++j)
880 const std::string propName = std::string(
"widget#") + std::to_string(j);
881 spinboxes[i]->setProperty(propName.c_str(), QVariant::fromValue< QDoubleSpinBox*>(spinboxes[j]));
888 void SParameters::createDoubleSliderWidget(QGridLayout& layout,
int row,
const std::string& key,
889 double defaultValue,
double min,
double max, std::uint8_t decimals)
892 QPushButton* resetButton = this->createResetButton();
894 layout.addWidget(resetButton, row, 5);
896 const double valueRange = max - min;
898 QSlider* slider =
new QSlider(Qt::Horizontal);
899 slider->setObjectName(QString::fromStdString(key));
901 slider->setProperty(
"key", QString::fromStdString(key));
902 slider->setProperty(
"count", 1);
903 slider->setProperty(
"defaultValue", defaultValue);
904 slider->setProperty(
"decimals", decimals);
905 slider->setProperty(
"min", min);
906 slider->setProperty(
"max", max);
908 setDoubleSliderRange(slider, defaultValue);
910 const int defaultSliderValue = int(std::round(((defaultValue - min) / valueRange) *
double(slider->maximum())));
911 slider->setValue(defaultSliderValue);
914 font.setPointSize(7);
915 font.setItalic(
true);
917 QLabel* minValueLabel =
new QLabel();
918 minValueLabel->setFont(font);
919 minValueLabel->setText(QString::number(min,
'g', decimals));
920 minValueLabel->setToolTip(
"Minimum value.");
922 QLabel* maxValueLabel =
new QLabel();
923 maxValueLabel->setFont(font);
924 maxValueLabel->setText(QString::number(max,
'g', decimals));
925 maxValueLabel->setToolTip(
"Maximum value.");
927 QLabel* valueLabel =
new QLabel();
928 valueLabel->setStyleSheet(
"QLabel { font: bold; }");
929 valueLabel->setText(QString::number(defaultValue,
'f', decimals));
930 valueLabel->setToolTip(
"Current value.");
931 this->setLabelMinimumSize(valueLabel, min, max, decimals);
933 layout.addWidget( minValueLabel, row, 1 );
934 layout.addWidget( slider, row, 2 );
935 layout.addWidget( maxValueLabel, row, 3 );
936 layout.addWidget( valueLabel, row, 4);
937 layout.addWidget( resetButton, row, 5);
940 QObject::connect(slider, SIGNAL(valueChanged(
int)),
this, SLOT(onChangeDoubleSlider(
int)));
943 QObject::connect(slider, &QSlider::valueChanged,
this, [ = ] {onDoubleSliderMapped(valueLabel, slider); });
944 QObject::connect(slider, &QSlider::rangeChanged,
this, [ = ]
946 onDoubleSliderRangeMapped(minValueLabel,
947 maxValueLabel, slider);
950 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetDoubleMapped(slider); });
952 const std::string propName = std::string(
"widget#0");
953 slider->setProperty(propName.c_str(), QVariant::fromValue< QSlider*>(slider));
958 void SParameters::createIntegerSliderWidget(QGridLayout& layout,
int row,
const std::string& key,
959 int defaultValue,
int min,
int max)
962 QPushButton* resetButton = this->createResetButton();
964 QSlider* slider =
new QSlider(Qt::Horizontal);
965 slider->setObjectName(QString::fromStdString(key));
966 slider->setMinimum(min);
967 slider->setMaximum(max);
968 slider->setValue(defaultValue);
971 font.setPointSize(7);
972 font.setItalic(
true);
974 QLabel* minValueLabel =
new QLabel();
975 minValueLabel->setFont(font);
976 minValueLabel->setText(QString::number(slider->minimum()));
977 minValueLabel->setToolTip(
"Minimum value.");
979 QLabel* maxValueLabel =
new QLabel();
980 maxValueLabel->setFont(font);
981 maxValueLabel->setText(QString::number(slider->maximum()));
982 maxValueLabel->setToolTip(
"Maximum value.");
984 QLabel* valueLabel =
new QLabel();
985 valueLabel->setStyleSheet(
"QLabel { font: bold; }");
986 valueLabel->setText(QString(
"%1").arg(slider->value()));
987 valueLabel->setToolTip(
"Current value.");
988 this->setLabelMinimumSize(valueLabel, min, max);
990 layout.addWidget( minValueLabel, row, 1 );
991 layout.addWidget( slider, row, 2 );
992 layout.addWidget( maxValueLabel, row, 3 );
993 layout.addWidget( valueLabel, row, 4);
994 layout.addWidget( resetButton, row, 5);
996 slider->setProperty(
"key", QString(key.c_str()));
997 slider->setProperty(
"count", 1);
998 slider->setProperty(
"defaultValue", slider->value());
1001 QObject::connect(slider, SIGNAL(valueChanged(
int)),
this, SLOT(onChangeInteger(
int)));
1004 QObject::connect(slider, &QSlider::valueChanged,
this, [ = ] {onSliderMapped(valueLabel, slider); });
1005 QObject::connect(slider, &QSlider::rangeChanged,
this, [ = ]
1007 onSliderRangeMapped(minValueLabel, maxValueLabel,
1011 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetIntegerMapped(slider); });
1013 const std::string propName = std::string(
"widget#0");
1014 slider->setProperty(propName.c_str(), QVariant::fromValue< QSlider*>(slider));
1019 void SParameters::createIntegerSpinWidget(QGridLayout& layout,
int row,
const std::string& key,
1020 int defaultValue,
int min,
int max,
int count)
1023 QPushButton* resetButton = this->createResetButton();
1025 layout.addWidget(resetButton, row, 5);
1027 QSpinBox* spinboxes[3];
1030 for(
int i = 0; i < count; ++i)
1032 QSpinBox* spinbox =
new QSpinBox();
1033 spinboxes[i] = spinbox;
1035 spinbox->setMinimum(min);
1036 spinbox->setMaximum(max);
1037 spinbox->setValue(defaultValue);
1039 spinbox->setProperty(
"key", QString(key.c_str()));
1040 spinbox->setProperty(
"count", count);
1041 spinbox->setProperty(
"defaultValue", spinbox->value());
1043 layout.addWidget(spinbox, row, i + 2);
1046 QObject::connect(spinbox, SIGNAL(valueChanged(
int)),
this, SLOT(onChangeInteger(
int)));
1049 QSpinBox* spinbox = spinboxes[0];
1050 spinbox->setObjectName(QString::fromStdString(key));
1051 QObject::connect(resetButton, &QPushButton::clicked,
this, [ = ] { onResetIntegerMapped(spinbox); });
1054 for(
int i = 0; i < count; ++i)
1056 for(
int j = 0; j < count; ++j)
1058 const std::string propName = std::string(
"widget#") + std::to_string(j);
1059 spinboxes[i]->setProperty(propName.c_str(), QVariant::fromValue< QSpinBox*>(spinboxes[j]));
1066 void SParameters::createEnumWidget(QGridLayout& layout,
int row,
const std::string& key,
1067 const std::string& defaultValue,
1068 const std::vector<std::string>& values,
1069 const std::vector<std::string>& data)
1071 QComboBox* menu =
new QComboBox();
1072 menu->setObjectName(QString::fromStdString(key));
1074 menu->setProperty(
"key", QString(key.c_str()));
1076 for(
const auto& value : values)
1078 menu->insertItem(idx, QString::fromStdString(value));
1084 for(
const auto& choice : data)
1086 menu->setItemData(idx, QString::fromStdString(choice));
1090 layout.addWidget(menu, row, 2);
1092 QObject::connect(menu, SIGNAL(currentIndexChanged(
int)),
this, SLOT(onChangeEnum(
int)));
1095 menu->setCurrentText(QString::fromStdString(defaultValue));
1100 double SParameters::getDoubleSliderValue(
const QSlider* slider)
1102 const double min = slider->property(
"min").toDouble();
1103 const double max = slider->property(
"max").toDouble();
1105 const double valueRange = max - min;
1106 double doubleValue = min;
1107 if (slider->maximum() != 0)
1109 doubleValue = (double(slider->value()) / slider->maximum()) * valueRange + min;
1117 void SParameters::setBoolParameter(
bool val, std::string key)
1119 this->blockSignals(
true);
1120 QWidget* child = this->getParamWidget(key);
1121 QCheckBox* checkbox = qobject_cast<QCheckBox*>(child);
1125 checkbox->setCheckState(val ? Qt::Checked : Qt::Unchecked);
1127 this->blockSignals(
false);
1132 void SParameters::setColorParameter(std::array<std::uint8_t, 4> color, std::string key)
1134 this->blockSignals(
true);
1135 QWidget* child = this->getParamWidget(key);
1136 QPushButton* colorButton = qobject_cast<QPushButton* >(child);
1140 const int iconSize = colorButton->style()->pixelMetric(QStyle::PM_LargeIconSize);
1141 QPixmap pix(iconSize, iconSize);
1142 QColor colorQt(color[0], color[1], color[2], color[3]);
1145 colorButton->setIcon(QIcon(pix));
1146 colorButton->setProperty(
"color", colorQt);
1148 this->blockSignals(
false);
1152 void SParameters::setDoubleParameter(
double val, std::string key)
1154 this->blockSignals(
true);
1155 QWidget* child = this->getParamWidget(key);
1157 QDoubleSpinBox* spinbox = qobject_cast<QDoubleSpinBox*>(child);
1158 QSlider* slider = qobject_cast<QSlider*>(child);
1162 spinbox->setValue(val);
1166 const double min = slider->property(
"min").toDouble();
1167 const double max = slider->property(
"max").toDouble();
1168 const double valueRange = max - min;
1169 const int sliderVal = int(std::round(((val - min) / valueRange) *
double(slider->maximum())));
1170 slider->setValue(sliderVal);
1174 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1176 this->blockSignals(
false);
1180 void SParameters::setDouble2Parameter(
double val0,
double val1, std::string key)
1182 this->blockSignals(
true);
1183 QWidget* child = this->getParamWidget(key);
1187 QDoubleSpinBox* spin0 = child->property(
"widget#0").value< QDoubleSpinBox*>();
1188 QDoubleSpinBox* spin1 = child->property(
"widget#1").value< QDoubleSpinBox*>();
1190 spin0->setValue(val0);
1191 spin1->setValue(val1);
1193 this->blockSignals(
false);
1197 void SParameters::setDouble3Parameter(
double val0,
double val1,
double val2, std::string key)
1199 this->blockSignals(
true);
1200 QWidget* child = this->getParamWidget(key);
1204 QDoubleSpinBox* spin0 = child->property(
"widget#0").value< QDoubleSpinBox*>();
1205 QDoubleSpinBox* spin1 = child->property(
"widget#1").value< QDoubleSpinBox*>();
1206 QDoubleSpinBox* spin2 = child->property(
"widget#2").value< QDoubleSpinBox*>();
1208 spin0->setValue(val0);
1209 spin1->setValue(val1);
1210 spin2->setValue(val2);
1212 this->blockSignals(
false);
1217 void SParameters::setIntParameter(
int val, std::string key)
1219 this->blockSignals(
true);
1220 QWidget* child = this->getParamWidget(key);
1222 QSpinBox* spinbox = qobject_cast<QSpinBox*>(child);
1223 QSlider* slider = qobject_cast<QSlider*>(child);
1227 spinbox->setValue(val);
1231 slider->setValue(val);
1235 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1237 this->blockSignals(
false);
1241 void SParameters::setInt2Parameter(
int val0,
int val1, std::string key)
1243 this->blockSignals(
true);
1244 QWidget* child = this->getParamWidget(key);
1248 QSpinBox* spin0 = child->property(
"widget#0").value< QSpinBox*>();
1249 QSpinBox* spin1 = child->property(
"widget#1").value< QSpinBox*>();
1251 spin0->setValue(val0);
1252 spin1->setValue(val1);
1254 this->blockSignals(
false);
1258 void SParameters::setInt3Parameter(
int val0,
int val1,
int val2, std::string key)
1260 this->blockSignals(
true);
1261 QWidget* widget = this->getParamWidget(key);
1265 QSpinBox* spin0 = widget->property(
"widget#0").value< QSpinBox*>();
1266 QSpinBox* spin1 = widget->property(
"widget#1").value< QSpinBox*>();
1267 QSpinBox* spin2 = widget->property(
"widget#2").value< QSpinBox*>();
1269 spin0->setValue(val0);
1270 spin1->setValue(val1);
1271 spin2->setValue(val2);
1273 this->blockSignals(
false);
1277 void SParameters::setEnumParameter(std::string val, std::string key)
1279 QWidget* widget = this->getParamWidget(key);
1281 QComboBox* combobox = qobject_cast<QComboBox*>(widget);
1285 combobox->setCurrentText(QString::fromStdString(val));
1287 this->blockSignals(
false);
1292 void SParameters::emitColorSignal(
const QColor color,
const std::string& key)
1294 const std::array<std::uint8_t, 4> newColor = {{
static_cast<std::uint8_t
>(color.red()),
1295 static_cast<std::uint8_t>(color.green()),
1296 static_cast<std::uint8_t>(color.blue()),
1297 static_cast<std::uint8_t>(color.alpha()) }};
1298 if (!m_blockSignals)
1300 this->signal<ColorChangedSignalType>(COLOR_CHANGED_SIG)->asyncEmit(newColor, key);
1301 OSLM_DEBUG(
"[EMIT] " << COLOR_CHANGED_SIG <<
"(" <<
int(newColor[0]) <<
", " <<
1302 int(newColor[1]) <<
", " <<
int(newColor[2]) <<
", " <<
int(newColor[3]) <<
", " << key <<
")" );
1308 void SParameters::blockSignals(
bool block)
1310 m_blockSignals = block;
1315 void SParameters::setIntMinParameter(
int min, std::string key)
1317 QWidget* child = this->getParamWidget(key);
1319 QSpinBox* spinbox = qobject_cast<QSpinBox*>(child);
1320 QSlider* slider = qobject_cast<QSlider*>(child);
1324 const int count = child->property(
"count").toInt();
1325 QSpinBox* spin0 = child->property(
"widget#0").value< QSpinBox*>();
1326 spin0->setMinimum(min);
1330 QSpinBox* spin1 = child->property(
"widget#1").value< QSpinBox*>();
1331 spin1->setMinimum(min);
1335 QSpinBox* spin2 = child->property(
"widget#2").value< QSpinBox*>();
1336 spin2->setMinimum(min);
1341 slider->setMinimum(min);
1345 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1350 void SParameters::setIntMaxParameter(
int max, std::string key)
1352 QWidget* child = this->getParamWidget(key);
1354 QSpinBox* spinbox = qobject_cast<QSpinBox*>(child);
1355 QSlider* slider = qobject_cast<QSlider*>(child);
1359 const int count = child->property(
"count").toInt();
1361 QSpinBox* spin0 = child->property(
"widget#0").value< QSpinBox*>();
1362 spin0->setMaximum(max);
1366 QSpinBox* spin1 = child->property(
"widget#1").value< QSpinBox*>();
1367 spin1->setMaximum(max);
1371 QSpinBox* spin2 = child->property(
"widget#2").value< QSpinBox*>();
1372 spin2->setMaximum(max);
1377 slider->setMaximum(max);
1381 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1386 void SParameters::setDoubleMinParameter(
double min, std::string key)
1388 QWidget* child = this->getParamWidget(key);
1390 QDoubleSpinBox* spinbox = qobject_cast<QDoubleSpinBox*>(child);
1391 QSlider* slider = qobject_cast<QSlider*>(child);
1395 const int count = child->property(
"count").toInt();
1397 QDoubleSpinBox* spin0 = child->property(
"widget#0").value< QDoubleSpinBox*>();
1398 spin0->setMinimum(min);
1402 QDoubleSpinBox* spin1 = child->property(
"widget#1").value< QDoubleSpinBox*>();
1403 spin1->setMinimum(min);
1407 QDoubleSpinBox* spin2 = child->property(
"widget#2").value< QDoubleSpinBox*>();
1408 spin2->setMinimum(min);
1413 const double value = getDoubleSliderValue(slider);
1414 slider->setProperty(
"min", min);
1415 setDoubleSliderRange(slider, value);
1419 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1425 void SParameters::setDoubleMaxParameter(
double max, std::string key)
1427 QWidget* child = this->getParamWidget(key);
1429 QDoubleSpinBox* spinbox = qobject_cast<QDoubleSpinBox*>(child);
1430 QSlider* slider = qobject_cast<QSlider*>(child);
1434 const int count = child->property(
"count").toInt();
1436 QDoubleSpinBox* spin0 = child->property(
"widget#0").value< QDoubleSpinBox*>();
1437 spin0->setMaximum(max);
1441 QDoubleSpinBox* spin1 = child->property(
"widget#1").value< QDoubleSpinBox*>();
1442 spin1->setMaximum(max);
1446 QDoubleSpinBox* spin2 = child->property(
"widget#2").value< QDoubleSpinBox*>();
1447 spin2->setMaximum(max);
1452 const double value = getDoubleSliderValue(slider);
1453 slider->setProperty(
"max", max);
1454 setDoubleSliderRange(slider, value);
1458 SLM_ERROR(
"Widget '" + key +
"' must be a QSlider or a QDoubleSpinBox");
1464 void SParameters::setDoubleSliderRange(QSlider* slider,
double currentValue)
1466 const std::string key = slider->property(
"key").toString().toStdString();
1467 const double min = slider->property(
"min").toDouble();
1468 const double max = slider->property(
"max").toDouble();
1469 const std::uint8_t decimals =
static_cast<std::uint8_t
>(slider->property(
"decimals").toUInt());
1470 int maxSliderValue = 1;
1471 for(std::uint8_t i = 0; i < decimals; ++i)
1473 maxSliderValue *= 10;
1476 const double valueRange = max - min;
1477 maxSliderValue *= valueRange;
1482 slider->setMinimum(0);
1484 SLM_ERROR_IF(
"The requested value range for '" + key +
"' is too large to be handled by a double slider. " 1485 "Please reduce your range, the number of decimals or use a 'spin' widget.",
1486 maxSliderValue < std::numeric_limits<double>::epsilon());
1487 if (maxSliderValue < std::numeric_limits<double>::epsilon())
1489 maxSliderValue = 1.;
1491 slider->setMaximum(maxSliderValue);
1494 if (currentValue <= min)
1496 slider->setValue(0);
1499 Q_EMIT slider->valueChanged(0);
1501 else if (currentValue > max)
1503 slider->setValue(maxSliderValue);
1507 const int sliderVal = int(std::round(((currentValue - min) / valueRange) *
double(slider->maximum())));
1508 slider->setValue(sliderVal);
1514 QWidget* SParameters::getParamWidget(
const std::string& key)
1516 auto qtContainer = ::fwGuiQt::container::QtContainer::dynamicCast(this->getContainer());
1517 const QWidget* widget = qtContainer->getQtContainer();
1519 QWidget* child = widget->findChild<QWidget*>(QString::fromStdString(key));
1520 SLM_ERROR_IF(
"Widget '" + key +
"' is not found", !child);
Defines the service interface managing the editor service for object.
GUIQT_API void starting() override
Initializes Qt input widgets for parameters according to xml configuration.
FWGUI_API void destroy()
Stops sub-views and toobar services. Destroys view, sub-views and toolbar containers.
GUIQT_API void stopping() override
This method launches the IEditor::stopping method.
GUIQT_API void configuring() override
Configure the editor.
#define SLM_ERROR(message)
#define SLM_ERROR_IF(message, cond)
GUIQT_API SParameters() noexcept
Constructor. Initializes signals.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
GUIQT_API void updating() override
This method is used to update services. Does nothing.
Generic editor to interact with parameters.
FWGUI_API void create()
Creates view, sub-views and toolbar containers. Manages sub-views and toobar services.
virtual GUIQT_API ~SParameters() noexcept
Destructor. Does nothing.
The namespace guiQt contains the basic services to build the application IHM with Qt...
FWGUI_API void initialize()
Initialize managers.
#define OSLM_DEBUG(message)
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.