WidgetDescription.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package ArmarXGui::ArmarXObjects::WidgetDescription
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "WidgetDescription.h"
24 
25 #include <ArmarXGui/interface/WidgetDescription.h>
27 
31 
32 #include <QVBoxLayout>
33 #include <QHBoxLayout>
34 #include <QLabel>
35 #include <QSpacerItem>
36 #include <QFormLayout>
37 #include <QDoubleSpinBox>
38 #include <QSpinBox>
39 #include <QLineEdit>
40 #include <QComboBox>
41 #include <QCheckBox>
42 #include <QDoubleValidator>
43 #include <QSlider>
44 #include <QGroupBox>
45 #include <QStandardItemModel>
46 #include <QStyledItemDelegate>
47 #include <QPointer>
48 #pragma GCC diagnostic push
49 #pragma GCC diagnostic ignored "-Wpedantic"
50 #include <qwt_slider.h>
51 
53 #pragma GCC diagnostic pop
54 
56 {
58  {
59  public:
61  std::map<std::string, VariantBasePtr> getVariants() override
62  {
63  return {};
64  }
65  };
67  //Layouts
69  {
70  public:
73  {
74  VBoxLayoutPtr ptr = VBoxLayoutPtr::dynamicCast(p);
76  setLayout(new QVBoxLayout);
77  layout()->setContentsMargins(0, 0, 0, 0);
78  for (const WidgetPtr& childPtr : ptr->children)
79  {
80  layout()->addWidget(addChild(childPtr));
81  }
82  }
83 
84  };
86 
88  {
89  public:
92  {
93  HBoxLayoutPtr ptr = HBoxLayoutPtr::dynamicCast(p);
95  setLayout(new QHBoxLayout);
96  layout()->setContentsMargins(0, 0, 0, 0);
97  for (const WidgetPtr& childPtr : ptr->children)
98  {
99  layout()->addWidget(addChild(childPtr));
100  }
101  }
102  };
104 
106  {
107  public:
110  {
111  FormLayoutPtr ptr = FormLayoutPtr::dynamicCast(p);
113  auto l = new QFormLayout;
114  setLayout(l);
115  layout()->setContentsMargins(0, 0, 0, 0);
116  for (const FormLayoutElementPtr& child : ptr->children)
117  {
118  if (child->childIsSpanning)
119  {
120  l->addRow(addChild(child->child));
121  continue;
122  }
123  if (child->labelWidget)
124  {
125  l->addRow(addChild(child->labelWidget), addChild(child->child));
126  continue;
127  }
128  l->addRow(QString::fromStdString(child->label), addChild(child->child));
129  }
130  }
131  };
133 
135  {
136  public:
139  {
140  FormLayoutElementPtr ptr = FormLayoutElementPtr::dynamicCast(p);
142  auto l = new QFormLayout;
143  setLayout(l);
144  layout()->setContentsMargins(0, 0, 0, 0);
145  if (ptr->childIsSpanning)
146  {
147  l->addRow(addChild(ptr->child));
148  }
149  if (ptr->labelWidget)
150  {
151  l->addRow(addChild(ptr->labelWidget), addChild(ptr->child));
152  }
153  l->addRow(QString::fromStdString(ptr->label), addChild(ptr->child));
154  }
155  };
157 
159  {
160  public:
163  {
164  GroupBoxPtr ptr = GroupBoxPtr::dynamicCast(p);
166  auto ltop = new QHBoxLayout;
167  setLayout(ltop);
168  layout()->setContentsMargins(0, 0, 0, 0);
169  QGroupBox* grp = new QGroupBox;
170  ltop->addWidget(grp);
171  grp->setTitle(QString::fromStdString(ptr->label));
172  auto l = new QHBoxLayout;
173  grp->setLayout(l);
174  l->setContentsMargins(0, 9, 0, 0);
175  l->addWidget(addChild(ptr->child));
176  }
177  };
179 
180  //static elements
182  {
183  public:
185  {
186  setLayout(new QVBoxLayout);
187  layout()->setContentsMargins(0, 0, 0, 0);
188  layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
189  }
190  std::map<std::string, VariantBasePtr> getVariants() override
191  {
192  return {};
193  }
194  };
196 
198  {
199  public:
201  {
202  setLayout(new QVBoxLayout);
203  layout()->setContentsMargins(0, 0, 0, 0);
204  layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
205  }
206  std::map<std::string, VariantBasePtr> getVariants() override
207  {
208  return {};
209  }
210  };
212 
214  {
215  public:
217  {
218  setFrameShape(QFrame::HLine);
219  setFrameShadow(QFrame::Sunken);
220  }
221  std::map<std::string, VariantBasePtr> getVariants() override
222  {
223  return {};
224  }
225  };
227 
229  {
230  public:
232  {
233  setFrameShape(QFrame::VLine);
234  setFrameShadow(QFrame::Sunken);
235  }
236  std::map<std::string, VariantBasePtr> getVariants() override
237  {
238  return {};
239  }
240  };
242 
244  {
245  public:
247  {
248  auto ptr = LabelPtr::dynamicCast(p);
250  setLayout(new QVBoxLayout);
251  layout()->setContentsMargins(0, 0, 0, 0);
252  layout()->addWidget(new QLabel(QString::fromStdString(ptr->text)));
253  }
254  std::map<std::string, VariantBasePtr> getVariants() override
255  {
256  return {};
257  }
258  };
260 
261  //dynamic content elements
263  {
264  public:
266  {
267  auto ptr = VariantWidgetPtr::dynamicCast(p);
269  setName(ptr->name);
270  setLayout(new QVBoxLayout);
271  child = new armarx::VariantWidget;
272  layout()->setContentsMargins(0, 0, 0, 0);
273  layout()->addWidget(child);
274  }
275  void variantWidgetUpdatedSlot(std::string name, VariantWidgetContent::VariantWidgetContentBasePtr data) override
276  {
277  if (name != getName())
278  {
279  return;
280  }
281  if (!data)
282  {
283  child->update(nullptr);
284  }
285  else if (data->ice_id() == VariantWidgetContent::SingleVariant::ice_staticId())
286  {
287  child->update(VariantWidgetContent::SingleVariantPtr::dynamicCast(data)->content);
288  }
289  else if (data->ice_id() == VariantWidgetContent::VariantMap::ice_staticId())
290  {
291  child->update(VariantWidgetContent::VariantMapPtr::dynamicCast(data)->content);
292  }
293  else if (data->ice_id() == VariantWidgetContent::VariantSeq::ice_staticId())
294  {
295  child->update(VariantWidgetContent::VariantSeqPtr::dynamicCast(data)->content);
296  }
297  }
298  private:
299  armarx::VariantWidget* child;
300  };
302 
303  //config elements
305  {
306  public:
308  {
309  CheckBoxPtr ptr = CheckBoxPtr::dynamicCast(p);
311  setName(ptr->name);
312  setLayout(new QVBoxLayout);
313  layout()->setContentsMargins(0, 0, 0, 0);
314  child = new QCheckBox {QString::fromStdString(ptr->label)};
315  child->setChecked(ptr->defaultValue);
316  layout()->addWidget(child);
317  connect(child, SIGNAL(clicked(bool)), this, SLOT(contentUpdated()));
318  }
319  std::map<std::string, VariantBasePtr> getVariants() override
320  {
321  return {{getName(), new Variant{child->isChecked()}}};
322  }
323  private:
324  QCheckBox* child;
325  protected:
326  void contentUpdated() override
327  {
328  emit valueChangedSignal(getName(), new Variant(child->isChecked()));
329  }
330  };
332 
334  {
335  public:
337  {
338  IntSpinBoxPtr ptr = IntSpinBoxPtr::dynamicCast(p);
340  setName(ptr->name);
341  setLayout(new QVBoxLayout);
342  layout()->setContentsMargins(0, 0, 0, 0);
343  child = new QSpinBox {};
344  child->setMaximum(ptr->max);
345  child->setMinimum(ptr->min);
346  child->setValue(ptr->defaultValue);
347  layout()->addWidget(child);
348  connect(child, SIGNAL(valueChanged(int)), this, SLOT(contentUpdated()));
349  }
350  std::map<std::string, VariantBasePtr> getVariants() override
351  {
352  return {{getName(), new Variant(child->value())}};
353  }
354  private:
355  QSpinBox* child;
356  protected:
357  void contentUpdated() override
358  {
359  emit valueChangedSignal(getName(), new Variant(child->value()));
360  }
361  };
363 
365  {
366  public:
368  {
369  DoubleSpinBoxPtr ptr = DoubleSpinBoxPtr::dynamicCast(p);
371  setName(ptr->name);
372  setLayout(new QVBoxLayout);
373  layout()->setContentsMargins(0, 0, 0, 0);
374  child = new QDoubleSpinBox {};
375  child->setMaximum(ptr->max);
376  child->setMinimum(ptr->min);
377  child->setDecimals(ptr->decimals);
378  child->setValue(ptr->defaultValue);
379  child->setSingleStep((ptr->max - ptr->min) / ptr->steps);
380  layout()->addWidget(child);
381  connect(child, SIGNAL(valueChanged(double)), this, SLOT(contentUpdated()));
382  }
383  std::map<std::string, VariantBasePtr> getVariants() override
384  {
385  return {{getName(), new Variant(child->value())}};
386  }
387  private:
388  QDoubleSpinBox* child;
389  protected:
390  void contentUpdated() override
391  {
392  emit valueChangedSignal(getName(), new Variant(child->value()));
393  }
394  };
396 
398  {
399  public:
401  {
402  FloatSpinBoxPtr ptr = FloatSpinBoxPtr::dynamicCast(p);
404  setName(ptr->name);
405  setLayout(new QVBoxLayout);
406  layout()->setContentsMargins(0, 0, 0, 0);
407  child = new QDoubleSpinBox {};
408  child->setMaximum(ptr->max);
409  child->setMinimum(ptr->min);
410  child->setDecimals(ptr->decimals);
411  child->setValue(ptr->defaultValue);
412  child->setSingleStep((ptr->max - ptr->min) / ptr->steps);
413  layout()->addWidget(child);
414  connect(child, SIGNAL(valueChanged(double)), this, SLOT(contentUpdated()));
415  }
416  std::map<std::string, VariantBasePtr> getVariants() override
417  {
418  return {{getName(), new Variant(static_cast<float>(child->value()))}};
419  }
420  private:
421  QDoubleSpinBox* child;
422  protected:
423  void contentUpdated() override
424  {
425  emit valueChangedSignal(getName(), new Variant(static_cast<float>(child->value())));
426  }
427  };
429 
430  class SubclassOfQStyledItemDelegate : public QStyledItemDelegate
431  {
432  public:
433  SubclassOfQStyledItemDelegate(QObject* parent = 0) : QStyledItemDelegate(parent) {}
434  void paint(QPainter* painter_, const QStyleOptionViewItem& option_, const QModelIndex& index_) const override
435  {
436  QStyleOptionViewItem& refToNonConstOption = const_cast<QStyleOptionViewItem&>(option_);
437  refToNonConstOption.showDecorationSelected = false;
438  //refToNonConstOption.state &= ~QStyle::State_HasFocus & ~QStyle::State_MouseOver;
439 
440  QStyledItemDelegate::paint(painter_, refToNonConstOption, index_);
441  }
442  };
443 
445  {
446  public:
448  {
449  StringComboBoxPtr ptr = StringComboBoxPtr::dynamicCast(p);
451  setName(ptr->name);
452  setLayout(new QVBoxLayout);
453  layout()->setContentsMargins(0, 0, 0, 0);
454  child = new QComboBox {};
455  multiSelect = ptr->multiSelect;
456  if (multiSelect)
457  {
458  model = new QStandardItemModel(ptr->options.size() + 1, 1);
459  QStandardItem* item = new QStandardItem("Please select items");
460  item->setFlags(Qt::NoItemFlags);
461  model->setItem(0, 0, item);
462 
463  int row = 1;
464  for (const auto& opt : ptr->options)
465  {
466  QStandardItem* item = new QStandardItem(QString::fromStdString(opt));
467 
468  item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
469  item->setData(Qt::Unchecked, Qt::CheckStateRole);
470 
471  model->setItem(row, 0, item);
472  row++;
473 
474  }
475  model->setParent(child);
476  child->setModel(model);
478  child->setItemDelegate(delegate);
479  child->setCurrentIndex(-1);
480  }
481  else
482  {
483  for (const auto& opt : ptr->options)
484  {
485  child->addItem(QString::fromStdString(opt));
486  }
487  ARMARX_CHECK_GREATER(ptr->options.size(), static_cast<std::size_t>(ptr->defaultIndex));
488  child->setCurrentIndex(child->findText(QString::fromStdString(ptr->options.at(ptr->defaultIndex))));
489  }
490  layout()->addWidget(child);
491 
492  connect(child, SIGNAL(currentIndexChanged(int)), this, SLOT(contentUpdated()));
493  }
494  std::map<std::string, VariantBasePtr> getVariants() override
495  {
496  if (multiSelect)
497  {
499  for (int i = 0; i < child->model()->rowCount(); ++i)
500  {
501  if (model->item(i)->checkState() == Qt::Checked)
502  {
503 
504  list->addVariant(child->itemText(i).toStdString());
505  }
506  }
507  ARMARX_DEBUG << "selected items: " << list->output();
508  return {{getName(), new Variant{list}}};
509  }
510  else
511  {
512  return {{getName(), new Variant{child->currentText().toStdString()}}};
513  }
514  }
515  private:
516  QPointer<QStandardItemModel> model = nullptr;
517  QComboBox* child;
518  bool multiSelect = false;
519  protected:
520  void contentUpdated() override
521  {
522  emit valueChangedSignal(getName(), new Variant {child->currentText().toStdString()});
523  }
524  };
526 
528  {
529  public:
531  {
532  LineEditPtr ptr = LineEditPtr::dynamicCast(p);
534  setName(ptr->name);
535  setLayout(new QVBoxLayout);
536  layout()->setContentsMargins(0, 0, 0, 0);
537  child = new QLineEdit {};
538  child->setText(QString::fromStdString(ptr->defaultValue));
539  layout()->addWidget(child);
540  connect(child, SIGNAL(editingFinished()), this, SLOT(contentUpdated()));
541  }
542  std::map<std::string, VariantBasePtr> getVariants() override
543  {
544  return {{getName(), new Variant{child->text().toStdString()}}};
545  }
546  private:
547  QLineEdit* child;
548  protected:
549  void contentUpdated() override
550  {
551  emit valueChangedSignal(getName(), new Variant {child->text().toStdString()});
552  }
553  };
555 
557  {
558  public:
560  {
561  DoubleLineEditPtr ptr = DoubleLineEditPtr::dynamicCast(p);
563  setName(ptr->name);
564  setLayout(new QVBoxLayout);
565  layout()->setContentsMargins(0, 0, 0, 0);
566  child = new QLineEdit {};
567  child->setText(QString::number(ptr->defaultValue));
568  child->setValidator(new QDoubleValidator {this});
569  layout()->addWidget(child);
570  connect(child, SIGNAL(editingFinished()), this, SLOT(contentUpdated()));
571  }
572  std::map<std::string, VariantBasePtr> getVariants() override
573  {
574  return {{getName(), new Variant{child->text().toDouble()}}};
575  }
576  private:
577  QLineEdit* child;
578  protected:
579  void contentUpdated() override
580  {
581  emit valueChangedSignal(getName(), new Variant {child->text().toDouble()});
582  }
583  };
585 
587  {
588  public:
590  {
591  FloatLineEditPtr ptr = FloatLineEditPtr::dynamicCast(p);
593  setName(ptr->name);
594  setLayout(new QVBoxLayout);
595  layout()->setContentsMargins(0, 0, 0, 0);
596  child = new QLineEdit {};
597  child->setText(QString::number(ptr->defaultValue));
598  child->setValidator(new QDoubleValidator {this});
599  layout()->addWidget(child);
600  connect(child, SIGNAL(editingFinished()), this, SLOT(contentUpdated()));
601  }
602  std::map<std::string, VariantBasePtr> getVariants() override
603  {
604  return {{getName(), new Variant{static_cast<float>(child->text().toDouble())}}};
605  }
606  private:
607  QLineEdit* child;
608  protected:
609  void contentUpdated() override
610  {
611  emit valueChangedSignal(getName(), new Variant {static_cast<float>(child->text().toDouble())});
612  }
613  };
615 
616 
618  {
619  public:
621  {
622  IntSliderPtr ptr = IntSliderPtr::dynamicCast(p);
624  setName(ptr->name);
625  setLayout(new QVBoxLayout);
626  layout()->setContentsMargins(0, 0, 0, 0);
627  child = new QSlider {};
628  child->setMaximum(ptr->max);
629  child->setMinimum(ptr->min);
630  child->setValue(ptr->defaultValue);
631  layout()->addWidget(child);
632  connect(child, SIGNAL(valueChanged(int)), this, SLOT(contentUpdated()));
633  }
634  std::map<std::string, VariantBasePtr> getVariants() override
635  {
636  return {{getName(), new Variant(child->value())}};
637  }
638  private:
639  QSlider* child;
640  protected:
641  void contentUpdated() override
642  {
643  emit valueChangedSignal(getName(), new Variant(child->value()));
644  }
645  };
647 
649  {
650  public:
652  {
653  DoubleSliderPtr ptr = DoubleSliderPtr::dynamicCast(p);
655  setName(ptr->name);
656  setLayout(new QVBoxLayout);
657  layout()->setContentsMargins(0, 0, 0, 0);
658  child = new QwtSlider {this};
659  child->setScale(ptr->min, ptr->max);
660  child->setOrientation(Qt::Horizontal);
661  child->setValue(ptr->defaultValue);
662  doubleLabel = new QLabel(QString::number(ptr->defaultValue, 'g', 4), this);
663  layout()->addWidget(child);
664  connect(child, SIGNAL(valueChanged(double)), this, SLOT(contentUpdated()));
665  }
666  std::map<std::string, VariantBasePtr> getVariants() override
667  {
668  return {{getName(), new Variant(child->value())}};
669  }
670  private:
671  QwtSlider* child;
672  QLabel* doubleLabel;
673  protected:
674  void contentUpdated() override
675  {
676  doubleLabel->setText(QString::number(child->value(), 'g', 4));
677  emit valueChangedSignal(getName(), new Variant(child->value()));
678  }
679  };
681 
683  {
684  public:
686  {
687  FloatSliderPtr ptr = FloatSliderPtr::dynamicCast(p);
689  setName(ptr->name);
690  setLayout(new QHBoxLayout);
691  layout()->setContentsMargins(0, 0, 0, 0);
692  child = new QwtSlider {this};
693  child->setScale(ptr->min, ptr->max);
694  child->setOrientation(Qt::Horizontal);
695  child->setValue(ptr->defaultValue);
696  floatLabel = new QLabel(QString::number(ptr->defaultValue, 'g', 4), this);
697  layout()->addWidget(child);
698  layout()->addWidget(floatLabel);
699  connect(child, SIGNAL(valueChanged(double)), this, SLOT(contentUpdated()));
700  }
701  std::map<std::string, VariantBasePtr> getVariants() override
702  {
703  return {{getName(), new Variant(static_cast<float>(child->value()))}};
704  }
705  private:
706  QwtSlider* child;
707  QLabel* floatLabel;
708  protected:
709  void contentUpdated() override
710  {
711  floatLabel->setText(QString::number(child->value(), 'g', 4));
712  emit valueChangedSignal(getName(), new Variant(static_cast<float>(child->value())));
713  }
714  };
716 
717  //functions from base classes
719 
720  std::map<std::string, VariantBasePtr> DescribedWidgetLayoutBase::getVariants()
721  {
722  std::map<std::string, VariantBasePtr> result;
723  for (DescribedWidgetBase* child : children)
724  {
725  mergeMaps(result, child->getVariants());
726  }
727  return result;
728  }
729 
731  {
734  children.emplace_back(c);
735  connect(
736  this, SIGNAL(variantWidgetUpdatedSignal(std::string, VariantWidgetContent::VariantWidgetContentBasePtr)),
737  c, SLOT(variantWidgetUpdatedSlot(std::string, VariantWidgetContent::VariantWidgetContentBasePtr))
738  );
739  return c;
740  }
741 
743  {
744  class ErrorMessageWidget : public DescribedWidgetBase
745  {
746  public:
747  ErrorMessageWidget(const std::string& errorMessage): DescribedWidgetBase(nullptr)
748  {
749  setLayout(new QVBoxLayout);
750  setName(".ErrorMessageWidget");
751  layout()->setContentsMargins(0, 0, 0, 0);
752  QLabel* label = new QLabel {QString::fromStdString(errorMessage)};
753  layout()->addWidget(label);
754  label->setStyleSheet("QLabel { background-color : yellow; color : red; }");
755  }
756  };
757 
758  if (!p)
759  {
760  return new ErrorMessageWidget {"Null WidgetPtr"};
761  }
762  auto type = p->ice_id();
763  if (DescribedWidgetFactory::has(type))
764  {
765  try
766  {
767  auto w = DescribedWidgetFactory::get(type)(p, listener);
768  if (listener)
769  {
770  QObject::connect(w, SIGNAL(valueChangedSignal(std::string, VariantBasePtr)), listener, SLOT(valueChangedSlot(std::string, VariantBasePtr)));
771  }
772  return w;
773  }
774  catch (std::exception& e)
775  {
776  return new ErrorMessageWidget {"DescribedWidgetFactory for " + type + " threw exception\n" + e.what()};
777  }
778  catch (...)
779  {
780  return new ErrorMessageWidget {"DescribedWidgetFactory for " + type + " threw exception"};
781  }
782  }
783  else
784  {
785  return new ErrorMessageWidget {"No DescribedWidgetFactory for " + type};
786  }
787  return new ErrorMessageWidget {"makeDescribedWidget: Unknown error"};
788  }
789 
791  {
792  if (ptr && ptr->framed)
793  {
794  setFrameShape(QFrame::StyledPanel);
795  }
796  }
797 
799  {
800  setFrameShape(QFrame::NoFrame);
801  setFrameShadow(QFrame::Raised);
802  }
803 
804 }
armarx::WidgetDescription::DescribedFloatSlider::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:709
armarx::WidgetDescription::DescribedVariantWidget::DescribedVariantWidget
DescribedVariantWidget(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:265
armarx::WidgetDescription::DescribedGroupBox::DescribedGroupBox
DescribedGroupBox(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:161
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
armarx::WidgetDescription::registerDescribedVLine
DescribedWidgetFactoryRegistration< DescribedVLine > registerDescribedVLine
Definition: WidgetDescription.cpp:241
SingleTypeVariantList.h
algorithm.h
armarx::VariantWidget::update
void update(const VariantBasePtr &v)
Definition: VariantWidget.cpp:423
armarx::Registrar::get
static const RegisteredType & get(const KeyType &key)
Returns the registered object for the given key.
Definition: Registrar.h:84
armarx::WidgetDescription::DescribedFloatLineEdit::DescribedFloatLineEdit
DescribedFloatLineEdit(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:589
armarx::Registrar::has
static bool has(const KeyType &key)
Definition: Registrar.h:94
armarx::WidgetDescription::DescribedVLine::DescribedVLine
DescribedVLine(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:231
armarx::WidgetDescription::DescribedDoubleSlider::DescribedDoubleSlider
DescribedDoubleSlider(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:651
armarx::WidgetDescription::DescribedCheckBox::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:326
armarx::WidgetDescription::DescribedWidgetLayoutBase::addChild
virtual DescribedWidgetBase * addChild(const WidgetPtr &childPtr)
Definition: WidgetDescription.cpp:730
armarx::WidgetDescription::DescribedWidgetBase::setName
virtual void setName(const std::string &name)
Definition: WidgetDescription.h:59
armarx::WidgetDescription::DescribedWidget::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:61
armarx::WidgetDescription::DescribedVSpacer::DescribedVSpacer
DescribedVSpacer(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:200
armarx::WidgetDescription::registerDescribedVBoxLayout
DescribedWidgetFactoryRegistration< DescribedVBoxLayout > registerDescribedVBoxLayout
Definition: WidgetDescription.cpp:85
armarx::WidgetDescription::DescribedFloatSpinBox::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:423
armarx::WidgetDescription::registerDescribedFloatSpinBox
DescribedWidgetFactoryRegistration< DescribedFloatSpinBox > registerDescribedFloatSpinBox
Definition: WidgetDescription.cpp:428
armarx::WidgetDescription::DescribedWidgetLayoutBase::listener
ValueChangedListenerInterface * listener
Definition: WidgetDescription.h:91
armarx::WidgetDescription::DescribedWidgetLayoutBase::children
std::vector< DescribedWidgetBase * > children
Definition: WidgetDescription.h:90
list
list(APPEND SOURCES ${QT_RESOURCES}) set(COMPONENT_LIBS ArmarXGui ArmarXCoreObservers ArmarXCoreEigen3Variants PlotterController $
Definition: CMakeLists.txt:49
VariantWidget.h
armarx::WidgetDescription::registerDescribedLabel
DescribedWidgetFactoryRegistration< DescribedLabel > registerDescribedLabel
Definition: WidgetDescription.cpp:259
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::WidgetDescription::DescribedFloatSpinBox::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:416
armarx::WidgetDescription::registerDescribedStringComboBox
DescribedWidgetFactoryRegistration< DescribedStringComboBox > registerDescribedStringComboBox
Definition: WidgetDescription.cpp:525
armarx::WidgetDescription::registerDescribedCheckBox
DescribedWidgetFactoryRegistration< DescribedCheckBox > registerDescribedCheckBox
Definition: WidgetDescription.cpp:331
armarx::WidgetDescription::DescribedVSpacer::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:206
ARMARX_CHECK_GREATER
#define ARMARX_CHECK_GREATER(lhs, rhs)
This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will thro...
Definition: ExpressionException.h:116
armarx::WidgetDescription::DescribedStringComboBox::DescribedStringComboBox
DescribedStringComboBox(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:447
armarx::WidgetDescription::registerDescribedVariantWidget
DescribedWidgetFactoryRegistration< DescribedVariantWidget > registerDescribedVariantWidget
Definition: WidgetDescription.cpp:301
WidgetDescription.h
armarx::WidgetDescription::DescribedWidgetBase::variantWidgetUpdatedSignal
void variantWidgetUpdatedSignal(std::string name, VariantWidgetContent::VariantWidgetContentBasePtr data)
armarx::WidgetDescription::registerDescribedHBoxLayout
DescribedWidgetFactoryRegistration< DescribedHBoxLayout > registerDescribedHBoxLayout
Definition: WidgetDescription.cpp:103
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::WidgetDescription::DescribedIntSpinBox
Definition: WidgetDescription.cpp:333
armarx::WidgetDescription::DescribedLineEdit::DescribedLineEdit
DescribedLineEdit(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:530
armarx::WidgetDescription::DescribedLabel::DescribedLabel
DescribedLabel(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:246
armarx::WidgetDescription::DescribedFloatSlider::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:701
armarx::WidgetDescription::registerDescribedHLine
DescribedWidgetFactoryRegistration< DescribedHLine > registerDescribedHLine
Definition: WidgetDescription.cpp:226
armarx::WidgetDescription::registerDescribedDoubleLineEdit
DescribedWidgetFactoryRegistration< DescribedDoubleLineEdit > registerDescribedDoubleLineEdit
Definition: WidgetDescription.cpp:584
armarx::WidgetDescription::DescribedDoubleLineEdit
Definition: WidgetDescription.cpp:556
armarx::WidgetDescription::DescribedFloatSlider::DescribedFloatSlider
DescribedFloatSlider(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:685
armarx::WidgetDescription::SubclassOfQStyledItemDelegate
Definition: WidgetDescription.cpp:430
armarx::WidgetDescription::SubclassOfQStyledItemDelegate::paint
void paint(QPainter *painter_, const QStyleOptionViewItem &option_, const QModelIndex &index_) const override
Definition: WidgetDescription.cpp:434
armarx::WidgetDescription::registerDescribedHSpacer
DescribedWidgetFactoryRegistration< DescribedHSpacer > registerDescribedHSpacer
Definition: WidgetDescription.cpp:195
armarx::WidgetDescription::ValueChangedListenerInterface
Definition: WidgetDescription.h:36
armarx::WidgetDescription::DescribedHBoxLayout::DescribedHBoxLayout
DescribedHBoxLayout(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:90
armarx::WidgetDescription::registerDescribedDoubleSlider
DescribedWidgetFactoryRegistration< DescribedDoubleSlider > registerDescribedDoubleSlider
Definition: WidgetDescription.cpp:680
armarx::WidgetDescription::DescribedHBoxLayout
Definition: WidgetDescription.cpp:87
armarx::WidgetDescription::registerDescribedFormLayoutElement
DescribedWidgetFactoryRegistration< DescribedFormLayoutElement > registerDescribedFormLayoutElement
Definition: WidgetDescription.cpp:156
armarx::WidgetDescription::DescribedHSpacer::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:190
armarx::WidgetDescription::DescribedDoubleSlider::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:666
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::WidgetDescription::DescribedIntSpinBox::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:357
armarx::WidgetDescription
Definition: DefaultWidgetDescriptions.cpp:27
armarx::WidgetDescription::DescribedFloatSpinBox::DescribedFloatSpinBox
DescribedFloatSpinBox(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:400
armarx::WidgetDescription::DescribedFormLayoutElement::DescribedFormLayoutElement
DescribedFormLayoutElement(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:137
armarx::WidgetDescription::DescribedStringComboBox
Definition: WidgetDescription.cpp:444
armarx::WidgetDescription::DescribedWidgetLayoutBase::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:720
armarx::WidgetDescription::DescribedFloatSlider
Definition: WidgetDescription.cpp:682
armarx::WidgetDescription::DescribedLineEdit::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:549
armarx::WidgetDescription::registerDescribedDoubleSpinBox
DescribedWidgetFactoryRegistration< DescribedDoubleSpinBox > registerDescribedDoubleSpinBox
Definition: WidgetDescription.cpp:395
armarx::WidgetDescription::registerDescribedFloatLineEdit
DescribedWidgetFactoryRegistration< DescribedFloatLineEdit > registerDescribedFloatLineEdit
Definition: WidgetDescription.cpp:614
armarx::WidgetDescription::DescribedIntSlider::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:641
armarx::WidgetDescription::DescribedWidget::DescribedWidget
DescribedWidget(const WidgetPtr &ptr, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:60
armarx::WidgetDescription::DescribedHLine::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:221
armarx::WidgetDescription::registerDescribedFloatSlider
DescribedWidgetFactoryRegistration< DescribedFloatSlider > registerDescribedFloatSlider
Definition: WidgetDescription.cpp:715
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::WidgetDescription::DescribedVLine::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:236
armarx::WidgetDescription::DescribedWidgetBase
Definition: WidgetDescription.h:45
armarx::WidgetDescription::registerDescribedWidget
DescribedWidgetFactoryRegistration< DescribedWidget > registerDescribedWidget
Definition: WidgetDescription.cpp:66
armarx::WidgetDescription::DescribedWidgetBase::getName
virtual std::string getName() const
Definition: WidgetDescription.h:55
armarx::WidgetDescription::DescribedDoubleSpinBox
Definition: WidgetDescription.cpp:364
armarx::WidgetDescription::DescribedWidgetBase::DescribedWidgetBase
DescribedWidgetBase(WidgetPtr ptr)
Definition: WidgetDescription.cpp:790
armarx::WidgetDescription::DescribedWidgetBase::valueChangedSignal
void valueChangedSignal(std::string name, VariantBasePtr value)
armarx::WidgetDescription::DescribedWidgetLayoutBase::variantWidgetUpdatedSlot
void variantWidgetUpdatedSlot(std::string name, VariantWidgetContent::VariantWidgetContentBasePtr data) override
Definition: WidgetDescription.h:83
armarx::WidgetDescription::DescribedFormLayoutElement
Definition: WidgetDescription.cpp:134
armarx::WidgetDescription::DescribedLabel
Definition: WidgetDescription.cpp:243
armarx::WidgetDescription::DescribedLineEdit::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:542
armarx::WidgetDescription::DescribedDoubleLineEdit::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:579
armarx::WidgetDescription::DescribedDoubleSlider
Definition: WidgetDescription.cpp:648
armarx::WidgetDescription::DescribedHLine
Definition: WidgetDescription.cpp:213
armarx::WidgetDescription::DescribedIntSlider
Definition: WidgetDescription.cpp:617
armarx::WidgetDescription::registerDescribedLineEdit
DescribedWidgetFactoryRegistration< DescribedLineEdit > registerDescribedLineEdit
Definition: WidgetDescription.cpp:554
armarx::WidgetDescription::makeDescribedWidget
DescribedWidgetBase * makeDescribedWidget(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:742
armarx::WidgetDescription::ValueChangedListenerInterface::ValueChangedListenerInterface
ValueChangedListenerInterface()
Definition: WidgetDescription.cpp:798
armarx::WidgetDescription::DescribedVLine
Definition: WidgetDescription.cpp:228
armarx::WidgetDescription::DescribedDoubleSpinBox::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:390
armarx::WidgetDescription::DescribedWidgetFactoryRegistration
Definition: WidgetDescription.h:97
armarx::WidgetDescription::DescribedFormLayout::DescribedFormLayout
DescribedFormLayout(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:108
armarx::WidgetDescription::DescribedLineEdit
Definition: WidgetDescription.cpp:527
armarx::WidgetDescription::registerDescribedFormLayout
DescribedWidgetFactoryRegistration< DescribedFormLayout > registerDescribedFormLayout
Definition: WidgetDescription.cpp:132
armarx::WidgetDescription::DescribedFloatLineEdit::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:609
armarx::WidgetDescription::DescribedVSpacer
Definition: WidgetDescription.cpp:197
armarx::WidgetDescription::DescribedFloatLineEdit
Definition: WidgetDescription.cpp:586
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::WidgetDescription::DescribedFormLayout
Definition: WidgetDescription.cpp:105
armarx::WidgetDescription::DescribedHLine::DescribedHLine
DescribedHLine(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:216
armarx::WidgetDescription::DescribedIntSlider::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:634
armarx::WidgetDescription::DescribedVariantWidget
Definition: WidgetDescription.cpp:262
armarx::WidgetDescription::DescribedIntSpinBox::DescribedIntSpinBox
DescribedIntSpinBox(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:336
armarx::WidgetDescription::registerDescribedVSpacer
DescribedWidgetFactoryRegistration< DescribedVSpacer > registerDescribedVSpacer
Definition: WidgetDescription.cpp:211
armarx::WidgetDescription::registerDescribedIntSpinBox
DescribedWidgetFactoryRegistration< DescribedIntSpinBox > registerDescribedIntSpinBox
Definition: WidgetDescription.cpp:362
armarx::WidgetDescription::DescribedWidgetLayoutBase::DescribedWidgetLayoutBase
DescribedWidgetLayoutBase(WidgetPtr ptr, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:718
armarx::WidgetDescription::DescribedDoubleLineEdit::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:572
armarx::WidgetDescription::DescribedCheckBox::DescribedCheckBox
DescribedCheckBox(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:307
armarx::WidgetDescription::DescribedVBoxLayout::DescribedVBoxLayout
DescribedVBoxLayout(const WidgetPtr &p, ValueChangedListenerInterface *listener)
Definition: WidgetDescription.cpp:71
armarx::WidgetDescription::DescribedDoubleLineEdit::DescribedDoubleLineEdit
DescribedDoubleLineEdit(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:559
armarx::mergeMaps
void mergeMaps(T &oldMap, const T &newMap, MergeMapsMode mergeMode=MergeMapsMode::OverrideOldValues)
Inserts and overwrites the values from oldMap with the values from newMap.
Definition: algorithm.h:223
armarx::WidgetDescription::DescribedIntSpinBox::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:350
Logging.h
armarx::WidgetDescription::DescribedLabel::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:254
armarx::WidgetDescription::DescribedStringComboBox::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:494
armarx::WidgetDescription::DescribedCheckBox
Definition: WidgetDescription.cpp:304
armarx::WidgetDescription::DescribedWidgetLayoutBase
Definition: WidgetDescription.h:73
armarx::WidgetDescription::DescribedFloatSpinBox
Definition: WidgetDescription.cpp:397
armarx::WidgetDescription::DescribedDoubleSpinBox::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:383
Variant.h
armarx::VariantType::SingleTypeVariantList
const VariantTypeId SingleTypeVariantList
Definition: SingleTypeVariantList.h:193
armarx::WidgetDescription::DescribedIntSlider::DescribedIntSlider
DescribedIntSlider(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:620
armarx::WidgetDescription::DescribedVBoxLayout
Definition: WidgetDescription.cpp:68
armarx::WidgetDescription::DescribedHSpacer::DescribedHSpacer
DescribedHSpacer(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:184
armarx::WidgetDescription::DescribedCheckBox::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:319
armarx::WidgetDescription::DescribedDoubleSlider::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:674
armarx::WidgetDescription::DescribedGroupBox
Definition: WidgetDescription.cpp:158
armarx::WidgetDescription::DescribedStringComboBox::contentUpdated
void contentUpdated() override
Definition: WidgetDescription.cpp:520
armarx::WidgetDescription::DescribedVariantWidget::variantWidgetUpdatedSlot
void variantWidgetUpdatedSlot(std::string name, VariantWidgetContent::VariantWidgetContentBasePtr data) override
Definition: WidgetDescription.cpp:275
armarx::WidgetDescription::SubclassOfQStyledItemDelegate::SubclassOfQStyledItemDelegate
SubclassOfQStyledItemDelegate(QObject *parent=0)
Definition: WidgetDescription.cpp:433
armarx::WidgetDescription::DescribedHSpacer
Definition: WidgetDescription.cpp:181
armarx::VariantWidget
Definition: VariantWidget.h:38
armarx::WidgetDescription::registerDescribedIntSlider
DescribedWidgetFactoryRegistration< DescribedIntSlider > registerDescribedIntSlider
Definition: WidgetDescription.cpp:646
armarx::WidgetDescription::DescribedFloatLineEdit::getVariants
std::map< std::string, VariantBasePtr > getVariants() override
Definition: WidgetDescription.cpp:602
armarx::WidgetDescription::DescribedWidget
Definition: WidgetDescription.cpp:57
armarx::WidgetDescription::DescribedDoubleSpinBox::DescribedDoubleSpinBox
DescribedDoubleSpinBox(const WidgetPtr &p, ValueChangedListenerInterface *)
Definition: WidgetDescription.cpp:367