AronTreeWidgetController.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stack>
4
5
#include <QTreeWidget>
6
7
#include <
ArmarXCore/core/system/ImportExportComponent.h
>
8
9
#include <
ArmarXGui/libraries/ArmarXGuiBase/ArmarXComponentWidgetController.h
>
10
#include <
ArmarXGui/libraries/ArmarXGuiBase/ArmarXGuiPlugin.h
>
11
12
#include "
AronTreeWidgetItem.h
"
13
#include "
Data.h
"
14
#include "visitors/AronTreeWidgetCreator.h"
15
16
namespace
armarx::skills::gui
17
{
18
// Main controller for any AronTreeWidget GUI. It attaches itself to the parent and needs the active widget.
19
// It's responsible to handle all signals for non-widget fields and click events.
20
class
AronTreeWidgetController
:
public
QObject
21
{
22
Q_OBJECT
23
public
:
24
AronTreeWidgetController
(QTreeWidget* tree,
25
QTreeWidgetItem* parent,
26
const
aron::type::ObjectPtr
& type,
27
const
aron::data::DictPtr
&
data
=
nullptr
);
28
29
aron::data::DictPtr
convertToAron
()
const
;
30
void
setFromAron
(
const
aron::data::DictPtr
&);
31
32
private
:
33
QTreeWidgetItem* parent;
34
QTreeWidget* tree;
35
36
aron::type::ObjectPtr
type;
37
38
private
slots:
39
// allows most primitive fields to be directly editable in the tree
40
// only String will open up a new widget
41
void
onTreeWidgetItemDoubleClicked(QTreeWidgetItem* item,
int
column);
42
// check the new user input. Maybe undo if the field must not be edited.
43
// Also highlight if the input cannot be parsed. (Or the errors are now fixed)
44
void
onTreeWidgetItemChanged(QTreeWidgetItem* item,
int
column);
45
46
public
slots:
47
// hook for items to show a context menu (add / delete element)
48
void
ShowContextMenu
(
const
QPoint&);
49
};
50
51
using
AronTreeWidgetControllerPtr
= std::shared_ptr<AronTreeWidgetController>;
52
}
// namespace armarx::skills::gui
armarx::skills::gui::AronTreeWidgetController::convertToAron
aron::data::DictPtr convertToAron() const
Definition:
AronTreeWidgetController.cpp:56
armarx::skills::gui::AronTreeWidgetController
Definition:
AronTreeWidgetController.h:20
armarx::skills::gui::AronTreeWidgetController::setFromAron
void setFromAron(const aron::data::DictPtr &)
Definition:
AronTreeWidgetController.cpp:70
armarx::skills::gui::AronTreeWidgetController::AronTreeWidgetController
AronTreeWidgetController(QTreeWidget *tree, QTreeWidgetItem *parent, const aron::type::ObjectPtr &type, const aron::data::DictPtr &data=nullptr)
Definition:
AronTreeWidgetController.cpp:11
armarx::skills::gui::AronTreeWidgetControllerPtr
std::shared_ptr< AronTreeWidgetController > AronTreeWidgetControllerPtr
Definition:
AronTreeWidgetController.h:51
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
data
uint8_t data[1]
Definition:
EtherCATFrame.h:68
armarx::skills::gui
Definition:
PeriodicUpdateWidget.cpp:11
Data.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition:
Dict.h:41
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition:
Object.h:36
AronTreeWidgetItem.h
armarx::skills::gui::AronTreeWidgetController::ShowContextMenu
void ShowContextMenu(const QPoint &)
Definition:
AronTreeWidgetController.cpp:80
ImportExportComponent.h
RobotAPI
libraries
skills_gui
aron_tree_widget
AronTreeWidgetController.h
Generated on Sat Oct 12 2024 09:14:07 for armarx_documentation by
1.8.17