Skip to content

Commit

Permalink
test(helloworld): enable autoReconnect in test to show off feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 19, 2015
1 parent a7f9a3a commit b746f45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tutorials/helloworld/receive/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down

0 comments on commit b746f45

Please sign in to comment.