Plasma Engine  2.0
Loading...
Searching...
No Matches
RawDocumentTreeWidget.moc.h
1#pragma once
2
3#include <EditorFramework/EditorFrameworkDLL.h>
4
5#include <EditorFramework/GUI/RawDocumentTreeModel.moc.h>
6#include <GuiFoundation/Widgets/ItemView.moc.h>
7#include <QSortFilterProxyModel>
8#include <QTreeView>
9#include <ToolsFoundation/Selection/SelectionManager.h>
10#include <memory>
11
14
15class PL_EDITORFRAMEWORK_DLL plQtDocumentTreeView : public plQtItemView<QTreeView>
16{
17 Q_OBJECT
18
19public:
20 plQtDocumentTreeView(QWidget* pParent);
21 plQtDocumentTreeView(QWidget* pParent, plDocument* pDocument, std::unique_ptr<plQtDocumentTreeModel> pCustomModel, plSelectionManager* pSelection = nullptr);
23
24 void Initialize(plDocument* pDocument, std::unique_ptr<plQtDocumentTreeModel> pCustomModel, plSelectionManager* pSelection = nullptr);
25
26 void EnsureLastSelectedItemVisible();
27
28 void SetAllowDragDrop(bool bAllow);
29 void SetAllowDeleteObjects(bool bAllow);
30
31 plQtTreeSearchFilterModel* GetProxyFilterModel() const { return m_pFilterModel.get(); }
32
33protected:
34 virtual bool event(QEvent* pEvent) override;
35
36private Q_SLOTS:
37 void on_selectionChanged_triggered(const QItemSelection& selected, const QItemSelection& deselected);
38
39private:
40 void SelectionEventHandler(const plSelectionManagerEvent& e);
41
42private:
43 std::unique_ptr<plQtDocumentTreeModel> m_pModel;
44 std::unique_ptr<plQtTreeSearchFilterModel> m_pFilterModel;
45 plSelectionManager* m_pSelectionManager = nullptr;
46 plDocument* m_pDocument = nullptr;
47 bool m_bBlockSelectionSignal = false;
48 bool m_bAllowDeleteObjects = false;
49};
50
Definition Document.h:57
Definition RawDocumentTreeWidget.moc.h:16
Template to be used with classes derived from QAbstractItemView. Allows the use of plQtItemDelegate.
Definition ItemView.moc.h:30
Definition TreeSearchFilterModel.moc.h:12
Selection Manager stores a set of selected document objects.
Definition SelectionManager.h:26
Definition SelectionManager.h:10