pqReaction.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 pqReaction_h
5 #define pqReaction_h
6 
8 #include <QAction>
9 #include <QObject>
10 
26 {
27  Q_OBJECT
28  typedef QObject Superclass;
29 
30 public:
34  pqReaction(QAction* parent, Qt::ConnectionType type = Qt::AutoConnection);
35  ~pqReaction() override;
36 
40  QAction* parentAction() const { return qobject_cast<QAction*>(this->parent()); }
41 
42 protected Q_SLOTS:
46  virtual void onTriggered() {}
47 
48  virtual void updateEnableState() {}
49  virtual void updateMasterEnableState(bool);
50 
51 protected: // NOLINT(readability-redundant-access-specifiers)
52  bool IsMaster;
53 
54 private:
55  Q_DISABLE_COPY(pqReaction)
56 };
57 
58 #endif
bool IsMaster
Definition: pqReaction.h:52
type
virtual void updateEnableState()
Definition: pqReaction.h:48
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
QAction * parentAction() const
Provides access to the parent action.
Definition: pqReaction.h:40
virtual void onTriggered()
Called when the action is triggered.
Definition: pqReaction.h:46