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 
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
static void lockViewSizeCustom()
Locks the view size with a custom resolution.
void onTriggered() override
Called when the action is triggered.
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
static void recordTest()
This is a superclass just to make it easier to collect all such reactions.
QAction * parentAction() const
Provides access to the parent action.
Definition: pqReaction.h:40
static void lockViewSize(bool)
Locks the view size for testing.
static void playTest()
pqTestingReaction can be used to recording or playing back tests.