pqTestingReaction.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 pqTestingReaction_h
5 #define pqTestingReaction_h
6 
7 #include "pqMasterOnlyReaction.h"
8 
13 class PQAPPLICATIONCOMPONENTS_EXPORT pqTestingReaction : public pqMasterOnlyReaction
14 {
15  Q_OBJECT
17 
18 public:
19  enum Mode
20  {
24  LOCK_VIEW_SIZE_CUSTOM
25  };
26 
27  pqTestingReaction(QAction* parentObject, Mode mode, Qt::ConnectionType type = Qt::AutoConnection);
28 
32  static void recordTest(const QString& filename);
33  static void recordTest();
34 
38  static void playTest(const QString& filename);
39  static void playTest();
40 
44  static void lockViewSize(bool);
45 
49  static void lockViewSizeCustom();
50 
51 protected:
52  void onTriggered() override
53  {
54  switch (this->ReactionMode)
55  {
56  case RECORD:
58  break;
59  case PLAYBACK:
61  break;
62  case LOCK_VIEW_SIZE:
63  pqTestingReaction::lockViewSize(this->parentAction()->isChecked());
64  break;
65  case LOCK_VIEW_SIZE_CUSTOM:
67  break;
68  }
69  }
70 
71 private:
72  Q_DISABLE_COPY(pqTestingReaction)
73  Mode ReactionMode;
74 };
75 
76 #endif
pqMasterOnlyReaction
Definition: pqMasterOnlyReaction.h:24
pqTestingReaction::lockViewSizeCustom
static void lockViewSizeCustom()
Locks the view size with a custom resolution.
pqReaction::parentAction
QAction * parentAction() const
Provides access to the parent action.
Definition: pqReaction.h:40
pqTestingReaction::onTriggered
void onTriggered() override
Called when the action is triggered.
Definition: pqTestingReaction.h:52
pqTestingReaction::Mode
Mode
Definition: pqTestingReaction.h:19
pqTestingReaction::recordTest
static void recordTest()
pqTestingReaction::RECORD
@ RECORD
Definition: pqTestingReaction.h:21
pqTestingReaction
Definition: pqTestingReaction.h:13
pqTestingReaction::playTest
static void playTest()
pqTestingReaction::PLAYBACK
@ PLAYBACK
Definition: pqTestingReaction.h:22
pqTestingReaction::lockViewSize
static void lockViewSize(bool)
Locks the view size for testing.
pqTestingReaction::LOCK_VIEW_SIZE
@ LOCK_VIEW_SIZE
Definition: pqTestingReaction.h:23
pqMasterOnlyReaction.h
pqReaction
Definition: pqReaction.h:25