-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpqObjectPlayer.h
More file actions
51 lines (42 loc) · 1.38 KB
/
pqObjectPlayer.h
File metadata and controls
51 lines (42 loc) · 1.38 KB
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
43
44
45
46
47
48
49
50
51
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef _pqObjectPlayer_h
#define _pqObjectPlayer_h
#include "QtTestingExport.h"
#include <QObject>
class QString;
/**
* Base Player class.
* It defines the API to play events.
* It handles the playback of "check" events for QObject, looking for QObject::property.
*/
class QTTESTING_EXPORT pqObjectPlayer : public QObject
{
Q_OBJECT
typedef QObject Superclass;
public:
pqObjectPlayer(QObject* parent = nullptr);
~pqObjectPlayer() override = default;
/**
* Entry point to handle events.
*
* If type is pqEventTypes::CHECK_EVENT, look for a QObject::property
* named as the "command" and test its value against "arguments".
*
* pqEventTypes::ACTION_EVENT is forwarded to playEvent(QObject*, QString, QString, bool&)
*
* Returns true if event was handled.
* Returns false if object is nullptr.
*/
virtual bool playEvent(
QObject* object, const QString& command, const QString& arguments, int eventType, bool& error);
/**
* Entry point for the pqEventTypes::ACTION_EVENT type only.
* Default implementation is no op and return false.
*/
virtual bool playEvent(QObject*, const QString&, const QString&, bool&);
private:
pqObjectPlayer(const pqObjectPlayer&);
pqObjectPlayer& operator=(const pqObjectPlayer&);
};
#endif // _pqBasicObjectPlayer_h