title: QtQuick menu Instantiator: notify about changed rows
body: <p>I have menu items model and <a href="http://qt-project.org/doc/qt-5.1/qtqml/qml-qtqml2-instantiator.html" rel="nofollow">Instantiator</a> for it.</p>
  
  <pre><code>Menu {
      id: backContextMenu
      Instantiator {
          model: backModel
          MenuItem {
              text: model.text
          }
          onObjectAdded: {
              console.log("QML: object added: " + object.text + ", index= " + index);
              backContextMenu.insertItem(index,object)
          }
          onObjectRemoved: {
              backContextMenu.removeItem(object)
              console.log("QML: object removed: " + object.text);
          }
      }
  }
  </code></pre>
  
  <p>When I add some items to model at index 0 signal <code>objectAdded</code> is emitted with new MenuItem and <code>index=0</code> as expected. But if I want to drop some items from model (for example, I have <code>["a";"b";"c";"d"]</code> in model and want to remove "a" and "b") menu items are dropped from another side ("c" and "d" are dropped, "a" and "b" are still alive). After some hacking I found workaround: If I remove <code>n</code> items from the beginning of model I should write</p>
  
  <pre><code>beginRemoveRows(QModelIndex(), _items.count()-n, _items.count()-1);
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>beginRemoveRows(QModelIndex(), 0, n-1);
  </code></pre>
  
  <p>Any ideas why items are removed from another side? I have <a href="https://github.com/Kakadu/qtquick_test_instantiator" rel="nofollow">demo</a> for you.</p>