-
Notifications
You must be signed in to change notification settings - Fork 14
/
pqPythonEventObserver.h
42 lines (31 loc) · 1.18 KB
/
pqPythonEventObserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
// SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
// SPDX-License-Identifier: BSD-3-Clause
#ifndef _pqPythonEventObserver_h
#define _pqPythonEventObserver_h
#include "pqEventObserver.h"
#include <QHash>
#include <QString>
/**
Observes high-level ParaView events, and serializes them to a stream as Python
for possible playback (as a test-case, demo, tutorial, etc). To use,
connect the onRecordEvent() slot to the pqEventTranslator::recordEvent()
signal.
\note Output is sent to the stream from this object's destructor, so you
must ensure that it goes out of scope before trying to playback the stream.
\sa pqEventTranslator, pqStdoutEventObserver, pqPythonEventSource.
*/
class QTTESTING_EXPORT pqPythonEventObserver : public pqEventObserver
{
Q_OBJECT
public:
pqPythonEventObserver(QObject* p = 0);
~pqPythonEventObserver();
void onRecordEvent(
const QString& Widget, const QString& Command, const QString& Arguments, const int& eventType);
void setStream(QTextStream*);
private:
/// Stores a stream that will be used to store the Python output
QHash<QString, QString> Names;
};
#endif // !_pqPythonEventObserver_h