29 #include <QAbstractGrpcClient>
30 #include <QGrpcStatus>
91 namespace QtProtobuf {
93 class QGrpcSubscription;
96 class QQuickGrpcSubscription :
public QObject
99 Q_PROPERTY(QAbstractGrpcClient *client READ client WRITE setClient NOTIFY clientChanged)
100 Q_PROPERTY(
bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
101 Q_PROPERTY(QString method READ method WRITE setMethod NOTIFY methodChanged)
102 Q_PROPERTY(QObject *argument READ argument WRITE setArgument NOTIFY argumentChanged)
103 Q_PROPERTY(QObject *returnValue READ returnValue NOTIFY returnValueChanged)
106 QQuickGrpcSubscription(QObject *parent =
nullptr);
107 ~QQuickGrpcSubscription();
109 QAbstractGrpcClient *client()
const {
113 bool enabled()
const {
117 QString method()
const {
121 QObject *argument()
const {
125 QObject *returnValue()
const {
126 return m_returnValue;
129 void setClient(QAbstractGrpcClient *client) {
130 if (m_client == client) {
135 emit clientChanged();
136 updateSubscription();
139 void setEnabled(
bool enabled) {
140 if (m_enabled == enabled) {
145 emit enabledChanged();
146 updateSubscription();
149 void setMethod(QString method) {
150 if (m_method == method) {
155 emit methodChanged();
156 updateSubscription();
159 void setArgument(QObject *argument) {
160 if (m_argument == argument) {
164 m_argument = argument;
165 emit argumentChanged();
166 updateSubscription();
170 void updated(
const QJSValue &value);
173 void clientChanged();
174 void methodChanged();
175 void enabledChanged();
176 void argumentChanged();
177 void returnValueChanged();
180 void updateSubscription();
182 QPointer<QAbstractGrpcClient> m_client;
185 QPointer<QObject> m_argument;
186 std::shared_ptr<QGrpcSubscription> m_subscription;
187 QObject *m_returnValue;
The QGrpcStatus class contains information about last gRPC operation.
Definition: qgrpcstatus.h:58