Plasma Engine  2.0
Loading...
Searching...
No Matches
PropertyGridWidget.moc.h
1#pragma once
2
3#include <Foundation/Containers/HybridArray.h>
4#include <GuiFoundation/GuiFoundationDLL.h>
5#include <GuiFoundation/PropertyGrid/Implementation/TypeWidget.moc.h>
6#include <GuiFoundation/PropertyGrid/PropertyBaseWidget.moc.h>
7#include <QWidget>
8#include <ToolsFoundation/Factory/RttiMappedObjectFactory.h>
9#include <ToolsFoundation/Object/DocumentObjectBase.h>
10#include <ToolsFoundation/Reflection/PhantomRttiManager.h>
11#include <ToolsFoundation/Selection/SelectionManager.h>
12
13class QSpacerItem;
14class QVBoxLayout;
15class QScrollArea;
16
18class plDocument;
25struct plPropertyDefaultEvent;
27
28class PL_GUIFOUNDATION_DLL plQtPropertyGridWidget : public QWidget
29{
30 Q_OBJECT
31public:
32 plQtPropertyGridWidget(QWidget* pParent, plDocument* pDocument = nullptr, bool bBindToSelectionManager = true);
34
35 void SetDocument(plDocument* pDocument, bool bBindToSelectionManager = true);
36
37 void ClearSelection();
38 void SetSelectionIncludeExcludeProperties(const char* szIncludeProperties = nullptr, const char* szExcludeProperties = nullptr);
39 void SetSelection(const plDeque<const plDocumentObject*>& selection);
40 const plDocument* GetDocument() const;
41 const plDocumentObjectManager* GetObjectManager() const;
42 plCommandHistory* GetCommandHistory() const;
43 plObjectAccessorBase* GetObjectAccessor() const;
44
46 static plQtPropertyWidget* CreateMemberPropertyWidget(const plAbstractProperty* pProp);
47 static plQtPropertyWidget* CreatePropertyWidget(const plAbstractProperty* pProp);
48
49 void SetCollapseState(plQtGroupBoxBase* pBox);
50
51Q_SIGNALS:
52 void ExtendContextMenu(QMenu& ref_menu, const plHybridArray<plPropertySelection, 8>& items, const plAbstractProperty* pProp);
53
54public Q_SLOTS:
55 void OnCollapseStateChanged(bool bCollapsed);
56
57private:
59 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(GuiFoundation, PropertyGrid);
60
61private:
62 void ObjectAccessorChangeEventHandler(const plObjectAccessorChangeEvent& e);
63 void SelectionEventHandler(const plSelectionManagerEvent& e);
64 void FactoryEventHandler(const plRttiMappedObjectFactory<plQtPropertyWidget>::Event& e);
65 void TypeEventHandler(const plPhantomRttiManagerEvent& e);
66 plUInt32 GetGroupBoxHash(plQtGroupBoxBase* pBox) const;
67
68private:
69 plDocument* m_pDocument;
70 bool m_bBindToSelectionManager = false;
72 plMap<plUInt32, bool> m_CollapseState;
73 plString m_sSelectionIncludeProperties;
74 plString m_sSelectionExcludeProperties;
75
76 QVBoxLayout* m_pLayout;
77 QScrollArea* m_pScroll;
78 QWidget* m_pContent;
79 QVBoxLayout* m_pContentLayout;
80
81 plQtTypeWidget* m_pTypeWidget;
82 QSpacerItem* m_pSpacer;
83};
84
This is the base interface for all properties in the reflection system. It provides enough informatio...
Definition AbstractProperty.h:150
Stores the undo / redo stacks of transactions done on a document.
Definition CommandHistory.h:52
Definition Deque.h:270
Definition Document.h:57
Represents to content of a document. Every document has exactly one root object under which all objec...
Definition DocumentObjectManager.h:116
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition Map.h:408
Definition ObjectAccessorBase.h:8
Definition GroupBoxBase.moc.h:10
Definition PropertyGridWidget.moc.h:29
Base class for all property widgets.
Definition PropertyBaseWidget.moc.h:28
Definition TypeWidget.moc.h:18
A factory that creates the closest matching objects according to the passed type.
Definition RttiMappedObjectFactory.h:13
Event that is broadcast whenever information about how to present elements in a container is required...
Definition PropertyMetaState.h:46
Used by plDocumentObjectManager::m_PropertyEvents.
Definition DocumentObjectManager.h:77
Definition Document.h:21
Definition PhantomRttiManager.h:10
Event that is broadcast whenever information about how to present properties is required.
Definition PropertyMetaState.h:35
Definition RttiMappedObjectFactory.h:27
Definition SelectionManager.h:10