AronTreeWidgetContextMenu.h
Go to the documentation of this file.
1#pragma once
2
3
4#include <QAction>
5
9
10class QTreeWidget;
11class QPoint;
12
13namespace armarx
14{
15
17
18 // Visitor on aron types. It creates a context menu dependent on the type of the AronTreeWidgetItem.
19 // Its only used for Lists and Dicts.
21 {
22
23 AronTreeWidgetItem* parentItem;
24 QTreeWidget* contextMenuParent;
25 const QPoint& pos;
26 int index;
27
28 public:
31 const QPoint& pos,
32 QTreeWidget* contextMenuParent,
33 int x);
34
35 void visitAronVariant(const aron::type::ObjectPtr&) final;
36 void visitAronVariant(const aron::type::DictPtr&) final;
37 void visitAronVariant(const aron::type::PairPtr&) final;
38 void visitAronVariant(const aron::type::TuplePtr&) final;
39 void visitAronVariant(const aron::type::ListPtr&) final;
41 void visitAronVariant(const aron::type::MatrixPtr&) final;
43 void visitAronVariant(const aron::type::ImagePtr&) final;
46 void visitAronVariant(const aron::type::IntPtr&) final;
47 void visitAronVariant(const aron::type::LongPtr&) final;
48 void visitAronVariant(const aron::type::FloatPtr&) final;
49 void visitAronVariant(const aron::type::DoublePtr&) final;
50 void visitAronVariant(const aron::type::BoolPtr&) final;
51 void visitAronVariant(const aron::type::StringPtr&) final;
52 void visitUnknown(Input&) final;
53
54 void showMenuAndExecute();
55
56 private:
57 std::list<QAction> actions;
58 std::vector<std::function<void()>> action_callbacks;
59
60 // Creates a remove option if the element is a direct child of a list or dict
61 void addDeleteAction();
62 void executeDelete();
63
64 void addAddAction();
65 void executeAddElement();
66 };
67} // namespace armarx
void visitAronVariant(const aron::type::ObjectPtr &) final
std::shared_ptr< class Quaternion > QuaternionPtr
std::shared_ptr< Object > ObjectPtr
Definition Object.h:36
std::shared_ptr< class Double > DoublePtr
std::shared_ptr< class Matrix > MatrixPtr
std::shared_ptr< class Image > ImagePtr
std::shared_ptr< class Long > LongPtr
std::shared_ptr< class String > StringPtr
std::shared_ptr< class PointCloud > PointCloudPtr
std::shared_ptr< class Pair > PairPtr
std::shared_ptr< class NDArray > NDArrayPtr
std::shared_ptr< class Int > IntPtr
std::shared_ptr< class Float > FloatPtr
std::shared_ptr< class Bool > BoolPtr
std::shared_ptr< class Tuple > TuplePtr
std::shared_ptr< class Dict > DictPtr
std::shared_ptr< IntEnum > IntEnumPtr
Definition IntEnum.h:36
std::shared_ptr< class List > ListPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
typename VisitorBase< const type::VariantPtr >::Input Input
Definition Visitor.h:103