title: Bound c++ value not updating in QML
body: <p>I read from an .ini file into an integer in c++, which is then utilised in QML through binding. In runtime, the value in the .ini file can be changed, which causes the c++ integer to also be changed. I'm finding that although the integer does indeed change in c++ (verified through qDebug()), the bound value in QML doesn't change, despite emitting the required changed() signal. Excerpts of my application structure are shown below:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>//Establish the QQmlApplication engine, set context properties for the two c++ files and load the QML file.
  
  QQmlApplicationEngine engine;
  engine.rootContext()-&gt;setContextProperty(QStringLiteral("MainCpp"), new MainCpp());
  engine.rootContext()-&gt;setContextProperty(QStringLiteral("Config"), new Config());
  engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
  </code></pre>
  
  <p>maincpp.h:</p>
  
  <pre><code>public:
      explicit MainCpp(QObject *parent = nullptr);
  
      Q_PROPERTY(int someValue READ someValue NOTIFY someValueChanged)
      int someValue(){return m_someValue;}
  
  signals:
      void someValueChanged();
  
  private:
      int    m_someValue;
  </code></pre>
  
  <p>config.h:</p>
  
  <pre><code>public:
      explicit Config(QObject *parent = nullptr);
  
      Q_PROPERTY(int someOtherValue READ someOtherValue NOTIFY someOtheralueChanged)
      int someOtherValue(){return m_someOtherValue;}
  
  signals:
      void someOtherValueChanged();
  
  public:
      void loadSettings();
  
  public:
      int      m_someOtherValue;
      QString  m_File;
  </code></pre>
  
  <p>config.cpp:</p>
  
  <pre><code>Config::Config(QObject *parent) : QObject(parent)
  {
      m_File = "/some/path/to/settings/file/config.ini";
      loadSettings();
  }
  
  void Config::loadSettings()
  {
      QSettings settings(m_File, QSettings::IniFormat);
      settings.beginGroup("GROUP_NAME");
      m_someOtherValue = settings.value("someOtherValueConfig", "").toInt();
      settings.endGroup();
  }
  </code></pre>
  
  <p>maincpp.cpp:</p>
  
  <pre><code>MainCpp::MainCpp(QObject *parent = nullptr) : QObject(parent)
  {
      Config configPointer;
      m_someValue = configPointer.someOtherValue();
      emit someValueChanged();
  }
  </code></pre>
  
  <p>main.qml:</p>
  
  <pre><code>Window {
      width: 800
      height: 480
  
      Text {
          id: someText
          text: Config.someOtherValue //This does NOT update on changes to m_someOtherValue on the c++ side
          //text: MainCpp.someValue //This DOES update on change to m_someValue on the c++ side
      }
  }
  </code></pre>
  
  <p>The following code is called within maincpp.cpp to update the .ini file:</p>
  
  <pre><code>void MainCpp::update(int var)
  {
      Config configPointer;
  
      QSettings settings("/some/path/to/settings/file/config.ini", QSettings::IniFormat);
      settings.setValue("GROUP_NAME/someOtherValueConfig", var);
      configPointer.m_someOtherValue = var;
      m_someValue = configPointer.someOtherValue;
      emit configPointer.someOtherValueChanged();
      emit someValueChanged();
  }
  </code></pre>
  
  <p>I've added 'emit someOtherValueChanged()' signals to no avail. As mentioned earlier, I know m_someOtherValue has changed, as I use query it with qDebug(). If m_someValue changes, why doesn't QML observe the change in m_someOtherValue?</p>