Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

MQTT Subscriptions Example

// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef SUBSCRIPTIONWINDOW_H
#define SUBSCRIPTIONWINDOW_H

#include <QWidget>
#include <QtMqtt/QMqttMessage>
#include <QtMqtt/QMqttSubscription>

namespace Ui {
class SubscriptionWindow;
}

class SubscriptionWindow : public QWidget
{
    Q_OBJECT

public:
    explicit SubscriptionWindow(QMqttSubscription *sub, QWidget *parent = nullptr);
    ~SubscriptionWindow();

public slots:
    void updateMessage(const QMqttMessage &msg);
    void updateStatus(QMqttSubscription::SubscriptionState state);
private:
    Ui::SubscriptionWindow *ui;
    QMqttSubscription *m_sub;
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded