I'd like to create a Menu in QML application that has other Menus depending on some Model. When I use Instantiator for that, items which are being created are parented to the Instantiator itself and when adding them to top-level Menu, it complains about `__parentMenu` being null

Qt Code:
  1. Menu {
  2. title: qsTr("Top-Level Menu")
  3. id: topMenu
  4.  
  5. Instantiator {
  6. model: aTopLevelModel
  7. onObjectAdded: topMenu.insertItem( index, object )
  8. onObjectRemoved: topMenu.removeItem( object )
  9.  
  10. delegate: Menu {
  11. id: innerMenu
  12. title: qsTr("Inner Menu")
  13.  
  14. Instantiator {
  15. model: aTopLevelModel.getInnerModel(index)
  16. onObjectAdded: innerMenu.insertItem( index, object )
  17. onObjectRemoved: innerMenu.removeItem( object )
  18.  
  19. delegate: MenuItem {
  20. text: qsTr("Menu action!")
  21. onTriggered: {
  22. console.log("Action of inner menu")
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }
To copy to clipboard, switch view to plain text mode 
The warning I'm observing is:
Qt Code:
  1. Menu.qml:149: TypeError: Cannot read property '__contentItem' of null
To copy to clipboard, switch view to plain text mode 
Where the line 149 is
Qt Code:
  1. property var __parentContentItem: __parentMenu.__contentItem
To copy to clipboard, switch view to plain text mode 
How can I overcome this Warning being produced?

Qt version is 5.5.1. This behavior is observed undre OS X and Windows versions of Qt.