pqPresetGroupsManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqPresetGroupsManager_h
6 #define pqPresetGroupsManager_h
7 
8 #include "pqComponentsModule.h" // for exports
9 
10 #include <QList>
11 #include <QMap>
12 #include <QObject>
13 
64 {
65  Q_OBJECT
66  typedef QObject Superclass;
67 
68 public:
73  pqPresetGroupsManager(QObject* p);
74  ~pqPresetGroupsManager() override;
75 
79  int numberOfGroups();
83  int numberOfPresetsInGroup(const QString& groupName);
88  int presetRankInGroup(const QString& presetName, const QString& groupName);
92  QList<QString> groupNames();
96  QString groupName(int i);
97 
105  void loadGroups(const QString& json);
106 
112  void replaceGroups(const QString& json);
113 
118  bool loadGroupsFromSettings();
119 
124  void addToGroup(const QString& groupName, const QString& presetName);
125 
129  void removeFromGroup(const QString& groupName, const QString& presetName);
130 
134  void removeFromAllGroups(const QString& presetName);
135 
136 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
140  void saveGroupsToSettings();
141 
142 Q_SIGNALS:
147  void groupsUpdated();
148 
149 private:
150  QList<QString> GroupNames;
151  QMap<QString, QList<QString>> Groups;
152 
159  void clearGroups();
160 };
161 
162 #endif
pqPresetGroupsManager is an object to manage the groups of color map presets displayed in the pqPrese...
#define PQCOMPONENTS_EXPORT