OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
SelectEntitiesDialog.h
Go to the documentation of this file.
1
5// ###########################################################################################################################################################################################################################################################################################################################
6
7#pragma once
8
9// OpenTwin header
14#include "OTWidgets/Dialog.h"
15
16// Qt header
17#include <QtCore/qstringlist.h>
18
19// std header
20#include <list>
21
22class QVBoxLayout;
23class QHBoxLayout;
24class QTreeWidgetItem;
25
26namespace ot {
27 class TreeWidget;
28 class TreeWidgetItem;
29 class TreeWidgetFilter;
30}
31
33 Q_OBJECT
35public:
36 SelectEntitiesDialog(const ot::SelectEntitiesDialogCfg& _config, QWidget* _parent = (QWidget*)nullptr);
38
39 bool selectionHasChanged(void) const;
40
44 std::list<std::string> selectedItemPaths(char _pathDelimiter = '/', bool _bottomLevelOnly = true) const;
45
46private Q_SLOTS:
47 void slotApply(void);
48 void slotCancel(void);
49 void slotAdd(QTreeWidgetItem* _item, int _col);
50 void slotRemove(QTreeWidgetItem* _item, int _col);
51
52private:
53 void addSelectedPaths(QTreeWidgetItem* _item, std::list<std::string>& _list, char _pathDelimiter, bool _bottomLevelOnly) const;
54 ot::TreeWidgetItem* addItem(ot::TreeWidget* _tree, QTreeWidgetItem* _parentItem, const ot::NavigationTreeItem& _item);
55
57 std::list<std::string> m_initiallySelected;
58 ot::TreeWidgetFilter* m_available;
59 ot::TreeWidgetFilter* m_selected;
60
61 SelectEntitiesDialog() = delete;
62};
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition SelectEntitiesDialog.h:32
~SelectEntitiesDialog()
Definition SelectEntitiesDialog.cpp:84
bool selectionHasChanged(void) const
Definition SelectEntitiesDialog.cpp:88
std::list< std::string > selectedItemPaths(char _pathDelimiter='/', bool _bottomLevelOnly=true) const
Returns the paths of the selected items.
Definition SelectEntitiesDialog.cpp:97
Definition Dialog.h:19
Definition NavigationTreeItem.h:35
Definition SelectEntitiesDialogCfg.h:18
Definition TreeWidgetFilter.h:25
Definition TreeWidget.h:23
Definition TreeWidgetItem.h:17
Definition Connector.h:8