From 8ff24d264c2dfdc0a0dca9d01a118ceeb643e90a Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Fri, 24 Apr 2020 14:27:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20Redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/redis/01_client/client.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/redis/01_client/client.hpp b/examples/redis/01_client/client.hpp index 69641f0..0aba388 100644 --- a/examples/redis/01_client/client.hpp +++ b/examples/redis/01_client/client.hpp @@ -13,11 +13,10 @@ class RedisClient : public QObject MR::Request* m_request; public: - RedisClient() + RedisClient(QObject* parent = nullptr) : QObject(parent) { connect(&m_client, &MR::Client::connected, this, &RedisClient::slotConnected); m_client.connectToHost("127.0.0.1"); - } virtual ~RedisClient() {} @@ -33,6 +32,9 @@ public: qDebug() << const_cast(reply).value().toString(); m_request->disconnect(); m_request->deleteLater(); + + m_request = m_client.sendCommand( "SET value 10" ); + connect(m_request, &MR::Request::reply, this, &RedisClient::slotSetValue); } @@ -62,6 +64,6 @@ public: Q_SLOT void slotSubscribeTest( const MR::Reply& reply) { qDebug() << static_cast(reply.type()); - qDebug() << const_cast(reply).value().toByteArray(); + qDebug() << const_cast(reply).value(); } };