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);
56 void setFilter(ProxyModelViewFilter* filter, bool owns_filter);
58 bool event(QEvent* e) override;
61 void setSelectedModelRoots(const Buffer<UUID>& roots, bool only_visible_children);
63 void setHeader(const TranslatedString& header_title, const String& header_icon);
66 void resizeEvent(QResizeEvent* size) override;
67 protected:
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:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core widget that allows the user to click one of many button types.
Definition Button.h:66
Definition ModelSelectionTree.h:48
void setModelManager(QTModelManager *manager)
void onExpandedSlot(const QModelIndex &index)
void updateFocus(UUID id, bool focussed)
Buffer< UUID > getModelRoots() const
void updateSelection(UUID id, bool selected)
void contextMenu(const QPoint &pos)
void onCollapsedSlot(const QModelIndex &index)
ModelSelectionTree(ProxyModelViewFilter *manager, bool owns_filter, QWidget *parent=nullptr)
ModelSelectionTree(QTModelManager *manager, QWidget *parent=nullptr)
QTModelManager * manager() const
ProxyModelViewFilter * filter() const
bool event(QEvent *e) override
Buffer< UUID > getSelectedModelRoots() const
void setHeader(const TranslatedString &header_title, const String &header_icon)
ModelSelectionTree(QWidget *parent=nullptr)
void setupFilter(ProxyModelViewFilter *filter)
void setFilter(ProxyModelViewFilter *filter, bool owns_filter)
void setSelectedModelRoots(const Buffer< UUID > &roots, bool only_visible_children)
void selectionChanged(const QItemSelection &selected, const QItemSelection &) override
void resizeEvent(QResizeEvent *size) override
void clickedSlot(const QModelIndex &index)
Filters and sorts Models from a ModelManager for views such as in a table or in a tree view.
Definition ProxyModelViewFilter.h:46
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37