forked from robertknight/Qt-Inspector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExternalObjectProxy.h
56 lines (46 loc) · 1.67 KB
/
ExternalObjectProxy.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
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "lib/ObjectProxy.h"
class TargetApplicationProxy;
/** Proxy representing a QObject in an external process. */
class ExternalObjectProxy : public ObjectProxy
{
public:
/** Construct a new proxy representing a QObject in the external process
* connected to @p appProxy. @p objectId is the internal ID assigned
* by the external process to this object.
*/
ExternalObjectProxy(TargetApplicationProxy* appProxy, int objectId);
// accessors used by TargetApplicationProxy to update the proxy
// using data received from the target process
int objectId() const;
void setClassName(const QString& className);
void setObjectName(const QString& objectName);
void setChildIds(const QList<int>& children);
void setAddress(quintptr address);
void setLoaded(bool loaded);
void addProperty(const Property& property);
void removeProperty(const QString& name);
void setPropertiesLoaded(bool loaded);
// implements ObjectProxy
virtual quintptr address() const;
virtual QString className() const;
virtual QString objectName() const;
virtual QList<ObjectProxy::Pointer> children();
virtual QList<Property> properties() const;
virtual void writeProperty(const QString& name, const QVariant& value);
virtual void refresh();
private:
// the proxy starts out as a flyweight. This is a blocking call
// to update the proxy's properties from the target process.
bool doLoad() const;
bool doPropertyLoad() const;
TargetApplicationProxy* m_appProxy;
int m_objectId;
bool m_isLoaded;
bool m_propertiesLoaded;
quintptr m_address;
QString m_className;
QString m_objectName;
QList<Property> m_properties;
QList<int> m_childIds;
};