SkillGroupBox.h
Go to the documentation of this file.
1 #ifndef SKILLGROUPBOX_H
2 #define SKILLGROUPBOX_H
3 
4 #include <QGroupBox>
5 #include <QLineEdit>
6 #include <QPushButton>
7 
8 #include "../memory/MemoryCommunicatorBase.h"
9 #include "SkillTreeWidget.h"
10 
11 namespace armarx::skills::gui
12 {
13  class SkillGroupBox : public QGroupBox, public MemoryCommunicatorBase
14  {
15  Q_OBJECT
16  public:
17  static const constexpr char* GROUP_BOX_TITLE = "Skills";
18 
19  SkillGroupBox(std::shared_ptr<SkillManagerWrapper> _memory, QWidget* parent = nullptr) :
20  QGroupBox(parent), MemoryCommunicatorBase(_memory)
21  {
22  setupUi();
23  }
24 
25  signals:
26  /**
27  * @brief Output signal to controller.
28  */
29  void searchRequest(std::string search);
30 
31  /**
32  * @brief Notify the skill description widget of an updated selection.
33  * @param skillId
34  */
35  void updateSkillDetails(skills::SkillID& skillId);
36 
37  void disconnectGui();
38 
39  public slots:
40  void connectGui(std::string observerName);
41 
43 
44  // is called, after the search has been accepted in the memory wrapper.
45  void searchCallback();
46 
47  private slots:
48  /**
49  * Takes string from line edit and emits the search request.
50  */
51  void handleSearch();
52 
53  /**
54  * @brief Applies the update, and requests an update from memory.
55  */
56  void filterAndFetch();
57 
58  private:
59  void setupUi();
60  void connectSignals();
61  QLineEdit* searchBar = nullptr;
62  QPushButton* acceptSearchButton = nullptr;
63  SkillTreeWidget* skillTreeWidget = nullptr;
64  };
65 } // namespace armarx::skills::gui
66 
67 #endif // SKILLGROUPBOX_H
armarx::skills::gui::SkillGroupBox::connectGui
void connectGui(std::string observerName)
Definition: SkillGroupBox.cpp:23
armarx::skills::gui::SkillGroupBox::updateSkillDetails
void updateSkillDetails(skills::SkillID &skillId)
Notify the skill description widget of an updated selection.
armarx::skills::gui::SkillGroupBox::disconnectGui
void disconnectGui()
armarx::skills::gui::SkillGroupBox::searchCallback
void searchCallback()
Definition: SkillGroupBox.cpp:35
armarx::skills::gui::SkillManagerWrapper::Snapshot
Definition: SkillManagerWrapper.h:70
armarx::skills::gui::SkillTreeWidget
Definition: SkillTreeWidget.h:15
armarx::skills::gui::SkillGroupBox
Definition: SkillGroupBox.h:13
armarx::skills::gui::SkillGroupBox::searchRequest
void searchRequest(std::string search)
Output signal to controller.
armarx::skills::gui
Definition: PeriodicUpdateWidget.cpp:11
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
armarx::skills::gui::SkillGroupBox::SkillGroupBox
SkillGroupBox(std::shared_ptr< SkillManagerWrapper > _memory, QWidget *parent=nullptr)
Definition: SkillGroupBox.h:19
armarx::skills::gui::SkillGroupBox::GROUP_BOX_TITLE
static const constexpr char * GROUP_BOX_TITLE
Definition: SkillGroupBox.h:17
SkillTreeWidget.h
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::skills::gui::MemoryCommunicatorBase
Definition: MemoryCommunicatorBase.h:14
armarx::skills::gui::SkillGroupBox::updateGui
void updateGui(SkillManagerWrapper::Snapshot update)
Definition: SkillGroupBox.cpp:29