OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsItemDesignerNavigation.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OToolkit header
10
11// OpenTwin header
13
14// Qt header
15#include <QtCore/qstring.h>
16
17// std header
18#include <map>
19#include <list>
20
26
27namespace ot { class PropertyGrid; }
28namespace ot { class GraphicsItemCfg; }
29
31 Q_OBJECT
34public:
37
38 void addRootItem(GraphicsItemDesignerItemBase* _item, bool _keepName);
39
40 bool isItemNameUnique(const QString& _itemName) const;
41
42 bool updateItemName(const QString& _oldName, const QString& _newName);
43
44 GraphicsItemDesignerItemBase* findDesignerItem(const QString& _itemName) const;
45
47
48 GraphicsItemDesignerNavigationRoot* getDesignerRootItem(void) const { return m_rootItem; };
49
50 void setCurrentSelection(const std::list<std::string>& _itemNames);
51
52 std::list<GraphicsItemDesignerItemBase*> getCurrentDesignerSelection(void) const;
53
54 bool hasDesignerItems(void) const { return !m_itemsMap.empty(); };
55
56 void updatePropertyGrid(void);
57
60 void clearDesignerItems(void);
61
63
64 void removeDesignerItems(const QStringList& _itemNames);
65
66private Q_SLOTS:
67 void slotSelectionChanged(void);
68
69protected:
70 virtual void keyPressEvent(QKeyEvent* _event) override;
71
73
74private:
75 QRectF calculateDesignerItemRect(void) const;
76
77 std::list<GraphicsItemDesignerItemBase*> m_rootItems;
78 std::map<QString, GraphicsItemDesignerItemBase*> m_itemsMap;
79
80 bool m_selectionChangeInProgress;
81 GraphicsItemDesigner* m_designer;
83 GraphicsItemDesignerPropertyHandler* m_currentPropertyHandler;
84};
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition GraphicsItemDesignerExportConfig.h:14
Definition GraphicsItemDesigner.h:31
Definition GraphicsItemDesignerItemBase.h:25
Definition GraphicsItemDesignerNavigation.h:30
bool isItemNameUnique(const QString &_itemName) const
Definition GraphicsItemDesignerNavigation.cpp:81
void updatePropertyGrid(void)
Definition GraphicsItemDesignerNavigation.cpp:222
bool updateItemName(const QString &_oldName, const QString &_newName)
Definition GraphicsItemDesignerNavigation.cpp:85
void clearDesignerItems(void)
Removes and destroys all designer items. The items will be removed from the view aswell.
Definition GraphicsItemDesignerNavigation.cpp:226
ot::GraphicsItemCfg * generateConfig(const GraphicsItemDesignerExportConfig &_exportConfig)
Definition GraphicsItemDesignerNavigation.cpp:120
void removeDesignerItems(const QStringList &_itemNames)
Definition GraphicsItemDesignerNavigation.cpp:260
void addRootItem(GraphicsItemDesignerItemBase *_item, bool _keepName)
Definition GraphicsItemDesignerNavigation.cpp:38
bool hasDesignerItems(void) const
Definition GraphicsItemDesignerNavigation.h:54
void setCurrentSelection(const std::list< std::string > &_itemNames)
Definition GraphicsItemDesignerNavigation.cpp:188
GraphicsItemDesignerNavigationRoot * getDesignerRootItem(void) const
Definition GraphicsItemDesignerNavigation.h:48
void forgetItem(GraphicsItemDesignerItemBase *_item)
Definition GraphicsItemDesignerNavigation.cpp:335
GraphicsItemDesignerItemBase * findDesignerItem(const QString &_itemName) const
Definition GraphicsItemDesignerNavigation.cpp:110
GraphicsItemDesignerNavigation(GraphicsItemDesigner *_designer)
Definition GraphicsItemDesignerNavigation.cpp:22
virtual void keyPressEvent(QKeyEvent *_event) override
Definition GraphicsItemDesignerNavigation.cpp:328
std::list< GraphicsItemDesignerItemBase * > getCurrentDesignerSelection(void) const
Definition GraphicsItemDesignerNavigation.cpp:206
virtual ~GraphicsItemDesignerNavigation()
Definition GraphicsItemDesignerNavigation.cpp:34
void removeSelectedDesignerItems(void)
Definition GraphicsItemDesignerNavigation.cpp:249
Definition GraphicsItemDesignerNavigationRoot.h:17
The GraphicsItemDesignerPropertyHandler is used to receive property grid notifications and requests.
Definition GraphicsItemDesignerPropertyHandler.h:39
Definition GraphicsItemDesignerView.h:17
The GraphicsItemCfg is the base class for all graphics item configurations.
Definition GraphicsItemCfg.h:33
Definition TreeWidget.h:23
Definition Connector.h:8