API Documentation
Loading...
Searching...
No Matches
ModelSelectionTree.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: ModelSelectionTree
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Buffer.h>
35#include <NDEVR/UUID.h>
36#include <QTreeView>
37class QTreeWidgetItem;
38namespace NDEVR
39{
40 class String;
41 class QTModelManagerView;
42 class Log;
43 class QTModelManager;
44 class ProxyModelViewFilter;
45 class Button;
46 class TranslatedString;
47 class NDEVR_API ModelSelectionTree : public QTreeView
48 {
49 Q_OBJECT
50 public:
51 explicit ModelSelectionTree(QWidget* parent = nullptr);
52 explicit ModelSelectionTree(QTModelManager* manager, QWidget* parent = nullptr);
53 explicit ModelSelectionTree(ProxyModelViewFilter* manager, bool owns_filter, QWidget* parent = nullptr);
54 virtual ~ModelSelectionTree();
55 void setModelManager(QTModelManager* manager);
56 void setFilter(ProxyModelViewFilter* filter, bool owns_filter);
57 QTModelManager* manager() const;
58 bool event(QEvent* e) override;
59 Buffer<UUID> getSelectedModelRoots() const;
60 Buffer<UUID> getModelRoots() const;
61 void setSelectedModelRoots(const Buffer<UUID>& roots, bool only_visible_children);
62 void expandSelected();
63 void setHeader(const TranslatedString& header_title, const String& header_icon);
64 void selectAllVisible();
65 ProxyModelViewFilter* filter() const;
66 void resizeEvent(QResizeEvent* size) override;
67 protected:
68 void setupFilter(ProxyModelViewFilter* filter);
69 signals:
71 protected:
72 void initialize();
73 protected slots:
74 void selectionChanged(const QItemSelection& selected, const QItemSelection&) override;
75 void updateFocus(UUID id, bool focussed);
76 void updateModel(UUID id);
77
78 void updateSelection(UUID id, bool selected);
79 void contextMenu(const QPoint &pos);
80 void onExpandedSlot(const QModelIndex& index);
81 void onCollapsedSlot(const QModelIndex& index);
82 void clickedSlot(const QModelIndex &index);
83 private:
84 ProxyModelViewFilter* m_design_model = nullptr;
85 Button* m_context_menu_button = nullptr;
86 bool m_auto_expanding = false;
87 bool m_owns_design_model = false;
88 };
89}
#define NDEVR_API
Definition DLLInfo.h:67
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Definition Button.h:60
Definition ModelSelectionTree.h:48
Definition ProxyModelViewFilter.h:43
Definition QTModelManager.h:94
The core String class for the software.
Definition String.h:47
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:62
Definition ACIColor.h:37