pqUndoRedoReaction.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 pqUndoRedoReaction_h
5 #define pqUndoRedoReaction_h
6 
7 #include "pqReaction.h"
8 
9 class pqUndoStack;
10 
16 {
17  Q_OBJECT
18  typedef pqReaction Superclass;
19 
20 public:
25  pqUndoRedoReaction(QAction* parent, bool undo);
26 
30  static void undo();
31 
35  static void redo();
36 
40  static void clear();
41 
42 protected Q_SLOTS:
43  void enable(bool);
44  void setLabel(const QString& label);
45  void setUndoStack(pqUndoStack*);
46 
47 protected: // NOLINT(readability-redundant-access-specifiers)
51  void onTriggered() override
52  {
53  if (this->Undo)
54  {
56  }
57  else
58  {
60  }
61  }
62 
63 private:
64  Q_DISABLE_COPY(pqUndoRedoReaction)
65 
66  bool Undo;
67 };
68 
69 #endif
static void redo()
redo.
static void undo()
undo.
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
void onTriggered() override
Called when the action is triggered.
Reaction for application undo-redo.
pqUndoStack represents a vtkSMUndoStack along with a a vtkSMUndoStackBuilder.
Definition: pqUndoStack.h:28