title: connect signal emitted from c++ to qml Connections
body: <p>I am emitting a signal from c++ and trying to fetch the values using Connections in qml. The codes are compiling however, due to some unknown reason qml is not able to recognise "<strong>OnSomethingHappened</strong>" and signal emitted from c++ is "<strong>somethingHappened</strong>".</p>
  
  <p>I know there can be other solutions but i need to use connections in qml. This is because of architecture used in qml. </p>
  
  <p>qmlclient.h</p>
  
  <pre><code>#ifndef QMLMQTTCLIENT_H
  #define QMLMQTTCLIENT_H
  
  #include &lt;QtCore/QMap&gt;
  #include &lt;QtMqtt/QMqttClient&gt;
  #include &lt;QtMqtt/QMqttSubscription&gt;
  
  class QmlMqttClient;
  
  class QmlMqttSubscription : public QObject
  {
      Q_OBJECT
      Q_PROPERTY(QMqttTopicFilter topic MEMBER m_topic NOTIFY topicChanged)
  public:
      QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c);
      ~QmlMqttSubscription();
  
  Q_SIGNALS:
      void topicChanged(QString);
      void messageReceived(QString &amp;msg);
      void somethingHappened(QString text);
  
  public slots:
      void handleMessage(const QMqttMessage &amp;qmsg);
  
  private:
      Q_DISABLE_COPY(QmlMqttSubscription)
      QMqttSubscription *sub;
      QmlMqttClient *client;
      QMqttTopicFilter m_topic;
  };
  
  class QmlMqttClient : public QMqttClient
  {
      Q_OBJECT
  public:
      QmlMqttClient(QObject *parent = nullptr);
  
      QmlMqttSubscription *subscribe(const QString &amp;topic);
  
      void sub();
  private:
      Q_DISABLE_COPY(QmlMqttClient)
  };
  
  
  #endif // QMLMQTTCLIENT_H*/
  </code></pre>
  
  <p>qmlmqttclient.cpp</p>
  
  <pre><code>#include "qmlmqttclient.h"
  #include &lt;QDebug&gt;
  
  QmlMqttClient::QmlMqttClient(QObject *parent)
      : QMqttClient(parent)
  {
  }
  
  QmlMqttSubscription* QmlMqttClient::subscribe(const QString &amp;topic)
  {
      auto sub = QMqttClient::subscribe(topic, 0);
      auto result = new QmlMqttSubscription(sub, this);
      return result;
  }
  
  QmlMqttSubscription::QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c)
      : sub(s)
      , client(c)
  {
      connect(sub, &amp;QMqttSubscription::messageReceived, this, &amp;QmlMqttSubscription::handleMessage);
     // m_topic = sub-&gt;topic();
  }
  
  QmlMqttSubscription::~QmlMqttSubscription()
  {
  
  }
  
  void QmlMqttSubscription::handleMessage(const QMqttMessage &amp;qmsg)
  {
      //emit messageReceived(qmsg.payload());
  
      emit somethingHappened(qmsg.payload());
  
      qDebug() &lt;&lt; "value -&gt; " + qmsg.payload();
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  
      QGuiApplication app(argc, argv);
  
  
      QmlMqttClient *client =  new QmlMqttClient();
      client-&gt;setHostname("127.0.0.1");
      client-&gt;setPort(1883);
  
      client-&gt;connectToHost();
      qDebug() &lt;&lt; client-&gt;state();
  
      QTimer timer;
      QObject::connect(&amp;timer, &amp;QTimer::timeout, [client]() {client-&gt;subscribe("/root/temp");});
      timer.setSingleShot(true);
      timer.start(5000);
  
  
  
      QQmlApplicationEngine engine;
  
      engine.rootContext()-&gt;setContextProperty("myModel",client);
  
      engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
  
      if (engine.rootObjects().isEmpty())
          return -1;
  
      return app.exec();
  }
  </code></pre>
  
  <p>main.qml</p>
  
  <pre><code>Window {
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")
  
      Rectangle {
          id: sensor
          color: "#ffffff"
          radius: 10
          x: 10
          y: 10
  
          property string address
          property string title
          property string unit
  
          Text{
              id: textField
  
              property var value : 0
  
              text: sensor.title + " " + value + " " + sensor.unit
              y:50
              font.family: "Helvetica"
              font.pointSize: 24
              anchors.horizontalCenter: parent.horizontalCenter
          }
  
          Connections
          {
              target: myModel
  
              onSomethingHappened: {
               console.log(" something happened " +text);
              }
          }
      }
  }
  </code></pre>
  
  <p>On running the above codes console shows </p>
  
  <pre><code>QML debugging is enabled. Only use this in a safe environment.
  1
  qrc:/main.qml:33:9: QML Connections: Cannot assign to non-existent property "onSomethingHappened"
  "value -&gt; -50"
  "value -&gt; -50"
  "value -&gt; -50"
  </code></pre>