SkillDetailsTreeWidget.h
Go to the documentation of this file.
1#ifndef SKILLDETAILSTREEWIDGET_H
2#define SKILLDETAILSTREEWIDGET_H
3
4#include <vector>
5
6#include <QTreeWidget>
7
11
13
14namespace armarx::skills::gui
15{
16 class SkillDetailsTreeWidget : public QTreeWidget, public MemoryCommunicatorBase
17 {
18 Q_OBJECT
19 public:
20 SkillDetailsTreeWidget(std::shared_ptr<SkillManagerWrapper> _memory,
21 QWidget* parent = nullptr);
22
23 std::optional<skills::SkillID> getShownId();
24 void updateContents(skills::SkillID const& skillId, skills::SkillDescription const& descr);
25
27 void pasteCurrentConfig();
28 void resetWidget();
29
30 signals:
31 void updated(const skills::SkillID shownSkill);
32
33 public slots:
34 // this will reset the args to the profile defaults
35 void resetCurrentConfig();
36 void copyCurrentConfig();
38 void disconnectGui();
40 void resizeContents();
43
44 private:
45 struct ShownSkill
46 {
47 skills::SkillID skillId;
49 armarx::aron::data::DictPtr originalParameters;
50 };
51
52 std::optional<ShownSkill> shownSkill;
53
54 // The size, which we assume the last column to be.
55 // If the last column has too little space, increase this value.
56 const int typeWidth = 200;
57
58 AronTreeWidgetControllerPtr aronTreeWidgetController = nullptr;
59 void setupUi();
60 void checkIfShownSkillIsAvailable(SkillManagerWrapper::Snapshot& update);
61 bool askUserToConfirmWidgetReset();
62 bool checkIfParametersAreModified();
63
64 bool showWidgetResetConfirmation_ = true;
65 };
66} // namespace armarx::skills::gui
67
68#endif // SKILLDETAILSTREEWIDGET_H
MemoryCommunicatorBase(std::shared_ptr< SkillManagerWrapper > _memory)
void resizeContents()
Problem: columns 0 and 1 have arbitrary size; so we want to limit their size, to make sure everything...
void updated(const skills::SkillID shownSkill)
void updateContents(skills::SkillID const &skillId, skills::SkillDescription const &descr)
SkillDetailsTreeWidget(std::shared_ptr< SkillManagerWrapper > _memory, QWidget *parent=nullptr)
void updateGui(SkillManagerWrapper::Snapshot update)
std::optional< skills::SkillID > getShownId()
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
std::shared_ptr< AronTreeWidgetController > AronTreeWidgetControllerPtr