title: QML TreeView not updating at runtime after adding new data to the model
body: <p>I have a QML <code>TreeView</code> that gets data through a <code>QStandardItemModel</code>. When the application is running, I press a button which adds a new entry. I know the data is changing, but the QML <code>TreeView</code> is not updating. I've also tried <code>beginResetModel()</code> and <code>endResetModel()</code>. The data is correctly displayed in the <code>TreeView</code> upon loading the application, but the <code>TreeView</code> does not change when modifying the data in the model. </p>
  
  <p>treeviewmodel.cpp</p>
  
  <pre><code>#include &lt;QDebug&gt;
  #include &lt;QStandardItemModel&gt;
  #include "treeviewmodel.h"
  
  TreeViewModel::TreeViewModel(QObject *parent) :
      QStandardItemModel(parent)
  {
      m_roleNameMapping[TreeViewModel_Role_Name] = "name_role";
  
      QStandardItem* entry;
      entry = new QStandardItem(QString("my_entry"));
      entry-&gt;setData("abc", TreeViewModel_Role_Name);
  
      auto childEntry = new QStandardItem( "my_child_entry" );
      childEntry-&gt;setData( "def",TreeViewModel_Role_Name);
      entry-&gt;appendRow(childEntry);
      appendRow( entry );
  
  }
  TreeViewModel&amp; TreeViewModel::Instance()
  {
      static TreeViewModel instance; //Guaranteed to be destroyed
      return instance;
  }
  void TreeViewModel::addEntry()
  {
      qDebug () &lt;&lt; "Adding entry...";
  
      QStandardItem* entry;
      entry = new QStandardItem(QString("my_entry"));
      entry-&gt;setData("Second Entry", TreeViewModel_Role_Name);
      auto childEntry = new QStandardItem( "my_child_entry" );
      childEntry-&gt;setData( "Second Entry Child",TreeViewModel_Role_Name);
      entry-&gt;appendRow(childEntry);
      appendRow( entry );
      qDebug () &lt;&lt; rowCount(); //Increases everytime I call the function
                               //Data is being added
  }
  QHash&lt;int, QByteArray&gt; TreeViewModel::roleNames() const
  {
      return m_roleNameMapping;
  }
  </code></pre>
  
  <p>main.qml</p>
  
  <pre><code>import treeModel 1.0
  ...
  MyTreeModel {
      id: theModel
  }
  
  //Left Tree View
  Rectangle {
      id: leftView
      Layout.minimumWidth: 50
      width: 200
      //Layout.fillWidth: true
      color: "white"
      TreeView {
          id: treeView
          anchors.fill: parent
          model: theModel
          TableViewColumn {
              role: "name_role"
              title: "Name"
          }
          TableViewColumn {
              role: "description_role"
              title: "Description"
          }
      }
  }
  
  ToolButton {
      iconSource: "lock.png"
      onClicked: {
      treeviewmodel.addEntry()
      }
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>QQmlContext* treeViewModelCtx = engine.rootContext();
  treeViewModelCtx-&gt;setContextProperty("treeviewmodel", &amp;TreeViewModel::Instance());
  
  //Register types
  qmlRegisterType&lt;TreeViewModel&gt;("treeModel", 1, 0, "MyTreeModel" );
  </code></pre>