From b746f45af5d09ba6fa5dad0081d89a6157520ed5 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Thu, 19 Nov 2015 17:46:39 -0500 Subject: [PATCH] test(helloworld): enable autoReconnect in test to show off feature --- tutorials/helloworld/receive/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutorials/helloworld/receive/main.cpp b/tutorials/helloworld/receive/main.cpp index 26982a7..9900502 100644 --- a/tutorials/helloworld/receive/main.cpp +++ b/tutorials/helloworld/receive/main.cpp @@ -9,7 +9,9 @@ class Receiver : public QObject { Q_OBJECT public: - Receiver(QObject *parent = 0) : QObject(parent) {} + Receiver(QObject *parent = 0) : QObject(parent) { + m_client.setAutoReconnect(true); + } public Q_SLOTS: void start() { @@ -20,6 +22,7 @@ public Q_SLOTS: private Q_SLOTS: void clientConnected() { QAmqpQueue *queue = m_client.createQueue("hello"); + disconnect(queue, 0, 0, 0); // in case this is a reconnect connect(queue, SIGNAL(declared()), this, SLOT(queueDeclared())); queue->declare(); }