pqConfigureCategoriesDialog.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef pqConfigureCategoriesDialog_h
5 #define pqConfigureCategoriesDialog_h
6 
8 #include <QDialog>
9 #include <QPointer>
10 
11 #include <memory>
12 
13 class pqProxyCategory;
15 class pqProxyInfo;
16 
17 class QString;
18 class QTreeWidget;
19 class QTreeWidgetItem;
20 
26 {
27  Q_OBJECT
28  typedef QDialog Superclass;
29 
30 public:
31  pqConfigureCategoriesDialog(pqProxyGroupMenuManager* manager, QWidget* parent = nullptr);
32  ~pqConfigureCategoriesDialog() override;
33 
34 protected Q_SLOTS:
38  void createNewCategory();
39 
44  void onAddPressed();
45 
50  void onRemovePressed();
51 
55  void resetToApplicationCategories();
56 
60  void onSetIconPressed();
61 
65  void onAccepted();
66 
70  void onSearchTextChanged(const QString& pattern);
71 
75  void onItemChanged(QTreeWidgetItem*, int);
76 
80  void updateToolbarState();
81 
82 private:
86  void populateCurrentCategoriesTree();
90  void populateAvailableProxiesTree();
92  void populateTree(QTreeWidgetItem* treeRoot);
94  QTreeWidgetItem* createProxyItem(
95  QTreeWidgetItem* parent, pqProxyInfo* info, QTreeWidgetItem* preceding = nullptr);
97  QTreeWidgetItem* createCategoryItem(
98  QTreeWidgetItem* parent, pqProxyCategory* info, QTreeWidgetItem* preceding = nullptr);
100  QTreeWidgetItem* createItem(
101  QTreeWidgetItem* parent, const QString& name, QTreeWidgetItem* preceding = nullptr);
103  QTreeWidgetItem* createCategory(
104  const QString& name, QTreeWidgetItem* parentItem, QTreeWidgetItem* precedingItem);
107  bool insertCategoryFromItem(
108  QTreeWidgetItem* sourceItem, QTreeWidgetItem* parentItem, QTreeWidgetItem* precedingItem);
111  bool insertProxyFromItem(
112  QTreeWidgetItem* sourceItem, QTreeWidgetItem* parentItem, QTreeWidgetItem* precedingItem);
114 
118 
122  bool customTreeHasSelection();
126  bool applicationTreeHasSelection();
131  QTreeWidgetItem* getSelectedItem();
139  QTreeWidgetItem* getNearestItem(QTreeWidgetItem* item);
147  QTreeWidgetItem* getSelectedCategoryItem();
151  QTreeWidgetItem* getSelectedProxyItem();
153 
157  bool eventFilter(QObject* object, QEvent* event) override;
158 
159  void keyPressEvent(QKeyEvent* event) override;
160 
164  void updateUIState();
165 
170  void deleteItem(QTreeWidgetItem* item);
174  void deleteCustomItems(QList<QTreeWidgetItem*> items);
175 
179  QTreeWidgetItem* getDestinationParentItem(QDropEvent* dropEvent);
183  QTreeWidgetItem* getDestinationItem(QDropEvent* dropEvent);
185  QTreeWidgetItem* getSourceItem(QDropEvent* dropEvent);
187  bool sourceIsCustomTree(QDropEvent* dropEvent);
189 
190  struct pqInternal;
191  std::unique_ptr<pqInternal> Internal;
192 
193  QString ResourceTag = "ParaViewFilters";
194 };
195 
196 #endif
pqProxyGroupMenuManager is a menu-populator that fills up a menu with proxies defined in an XML confi...
pqConfigureCategoriesDialog is the Configure Categories dialog used by ParaView.
info
#define PQAPPLICATIONCOMPONENTS_EXPORT
Proxy meta data structure for the User Interface.
Definition: pqProxyInfo.h:20
name
The pqProxyCategory class reads and writes XML that describes the proxies organisation into categorie...