mirror of
https://github.com/qt/qtmqtt.git
synced 2026-10-25 16:16:26 +00:00
Fix signal/slot problem with quicksubscription example
The example does not build with latest changes. As it turns out there is a mismatch between the topic property and the connected signal. Since the signal is not used, it is removed in the hope that it will then build. The error message from the build is: Failure Summary: The build failed due to a compilation error in 'qmlmqttclient.cpp'. The function 'QmlMqttSubscription::topicChanged()' was called without the required 'QString' argument. Log snippet: error: no matching function for call to ‘QmlMqttSubscription::topicChanged()’ note: candidate: ‘void QmlMqttSubscription::topicChanged(QString)’ note: candidate expects 1 argument, 0 provided Change-Id: Ia8cedda578e2f2c082354892bd00cb9fd25b5652 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
83db4482e7
commit
b539b0c38b
@ -9,7 +9,6 @@ QmlMqttSubscription::QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c)
|
|||||||
, client(c)
|
, client(c)
|
||||||
{
|
{
|
||||||
connect(sub, &QMqttSubscription::messageReceived, this, &QmlMqttSubscription::handleMessage);
|
connect(sub, &QMqttSubscription::messageReceived, this, &QmlMqttSubscription::handleMessage);
|
||||||
m_topic = sub->topic();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlMqttSubscription::~QmlMqttSubscription()
|
QmlMqttSubscription::~QmlMqttSubscription()
|
||||||
|
|||||||
@ -15,14 +15,12 @@ class QmlMqttClient;
|
|||||||
class QmlMqttSubscription : public QObject
|
class QmlMqttSubscription : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QMqttTopicFilter topic MEMBER m_topic NOTIFY topicChanged)
|
|
||||||
QML_UNCREATABLE("Not intended to be creatable")
|
QML_UNCREATABLE("Not intended to be creatable")
|
||||||
public:
|
public:
|
||||||
QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c);
|
QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c);
|
||||||
~QmlMqttSubscription();
|
~QmlMqttSubscription();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void topicChanged(QString);
|
|
||||||
void messageReceived(const QString &msg);
|
void messageReceived(const QString &msg);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -32,7 +30,6 @@ private:
|
|||||||
Q_DISABLE_COPY(QmlMqttSubscription)
|
Q_DISABLE_COPY(QmlMqttSubscription)
|
||||||
QMqttSubscription *sub;
|
QMqttSubscription *sub;
|
||||||
QmlMqttClient *client;
|
QmlMqttClient *client;
|
||||||
QMqttTopicFilter m_topic;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmlMqttClient : public QObject
|
class QmlMqttClient : public QObject
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user