SkillTreeWidget.h
Go to the documentation of this file.
1#ifndef ARMARX_SKILLS_GUI_SKILLTREEWIDGET_H
2#define ARMARX_SKILLS_GUI_SKILLTREEWIDGET_H
3
4#include <QTreeWidget>
5
7
9
10namespace armarx::skills::gui
11{
12 using SkillMap =
13 std::map<skills::ProviderID, std::map<skills::SkillID, skills::SkillDescription>>;
14
15 class SkillTreeWidget : public QTreeWidget, public MemoryCommunicatorBase
16 {
17 Q_OBJECT
18 public:
19 SkillTreeWidget(std::shared_ptr<SkillManagerWrapper> _memory, QWidget* parent = nullptr) :
20 QTreeWidget(parent), MemoryCommunicatorBase(_memory)
21 {
22 setupUi();
23 }
24
26 {
28
29 // make default constructable
31 skillId({.providerId = std::nullopt, .skillName = skills::SkillID::UNKNOWN})
32 {
33 }
34 };
35
37
38 signals:
39 /**
40 * @brief Notify the skill description widget of an updated selection.
41 * @param skillId
42 */
44
45 public slots:
46 void disconnectGui();
47
48 void updateGui(SkillMap update);
49
50 private slots:
51 void skillSelectionChanged(QTreeWidgetItem* current, int column);
52
53
54 private:
55 SelectedSkill selectedSkill;
56
57 static const constexpr bool PROVIDER_EXPANDED_DEFAULT = true;
58
59 void setupUi();
60 void connectSignals();
61 };
62
63} // namespace armarx::skills::gui
64
65#endif // ARMARX_SKILLS_GUI_SKILLTREEWIDGET_H
static const constexpr char * UNKNOWN
Definition SkillID.h:18
MemoryCommunicatorBase(std::shared_ptr< SkillManagerWrapper > _memory)
void updateSkillDetails(skills::SkillID &skillId)
Notify the skill description widget of an updated selection.
SkillTreeWidget(std::shared_ptr< SkillManagerWrapper > _memory, QWidget *parent=nullptr)
std::map< skills::ProviderID, std::map< skills::SkillID, skills::SkillDescription > > SkillMap