pqPreviewMenuManager.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 #ifndef pqPreviewMenuManager_h
5 #define pqPreviewMenuManager_h
6 
8 #include "pqTimer.h" // for pqTimer;
9 #include <QObject>
10 #include <QPointer>
11 
12 class QMenu;
13 class QAction;
14 
35 {
36  Q_OBJECT
37  typedef QObject Superclass;
38 
39 public:
43  pqPreviewMenuManager(QMenu* parent);
44 
50  pqPreviewMenuManager(const QStringList& defaultItems, QMenu* parent);
51 
52  ~pqPreviewMenuManager() override;
53 
57  QMenu* parentMenu() const;
58 
63  void lockResolution(int dx, int dy);
64 
68  void unlock();
69 
70 private Q_SLOTS:
71  void updateEnabledState();
72  void addCustom();
73  void lockResolution(bool lock);
74  void lockResolution(int dx, int dy, QAction* target);
79  void aboutToShow();
80 
81 private: // NOLINT(readability-redundant-access-specifiers)
82  void updateCustomActions();
83  QAction* findAction(int dx, int dy);
84  bool prependCustomResolution(int dx, int dy, const QString& label);
85  QPointer<QAction> FirstCustomAction;
86  pqTimer Timer;
87 
88  Q_DISABLE_COPY(pqPreviewMenuManager);
89  void init(const QStringList& defaultItems, QMenu* parentMenu);
90 };
91 
92 #endif
builds and manages menu for preview modes
boost::graph_traits< vtkGraph *>::vertex_descriptor target(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
#define PQAPPLICATIONCOMPONENTS_EXPORT