12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include <QObject>
- #include <memory>
- #include "tutorial.qpb.h"
- #include "tutorial_grpc.qpb.h"
- class EchoClientEngine : public QObject
- {
- Q_OBJECT
- Q_PROPERTY(qtprotobuf::tutorial::EchoResponse *response READ response CONSTANT)
- public:
- explicit EchoClientEngine(QObject *parent = nullptr);
- Q_INVOKABLE void request(qtprotobuf::tutorial::EchoRequest *req);
- qtprotobuf::tutorial::EchoResponse *response() const
- {
- return m_response.get();
- }
- private:
- std::unique_ptr<qtprotobuf::tutorial::EchoServiceClient> m_client;
- std::unique_ptr<qtprotobuf::tutorial::EchoResponse> m_response;
- };
|