title: Binding specific item of a ListModel to a Component
body: <p>I am building an application with HsQML. This is my first encounter with QML, my second ever work in Qt, and first larger project with Haskell, so forgive my ignorance.</p>
  
  <p>In the UI, I have a TabView. The first Tab contains a ListView which is bound to a model and displays a list of items. Double-clicking an item in the ListView opens a new tab with a component which correctly shows that item's details (my guess is by virtue of the new tab inheriting its context from the list item that was clicked).</p>
  
  <p>Now, my objective is to open a tab in which to create a new item for that model. The idea is to create a blank data item (optionally adding it to the model), and "load" this into the same component type used for editing existing items. I scoured QML's documentation and could not find anything even remotely related, which makes me think the approach is completely flawed.</p>
  
  <pre><code>TabView {
      id : rootTabs
  
      Tab {
          ListView {
              model : AutoListModel {
                  source : workflowModel // this is sort of HsQML specific, data comes as a list from Haskell
              }
              delegate : Rectangle {
                  Text {
                      text : modelData.name
                  }
  
                  MouseArea {
                      anchors.fill : parent
  
                      // this part works because the new component inherits its modelData from the current context
                      // so the new tab has correct data
                      onDoubleClicked : {
                          rootTabs.addTab(modelData.name, Qt.createComponent("WorkflowView.qml"))
                          rootTabs.currentIndex = rootTabsCount - 1
                      }
                  }
              }
          }
  
          Button {
              text : "Create workflow"
  
              // this is the part in question - how do I assign the newly appended data to comp?
              onClicked : {
                  wModel.appendBlank()
                  comp = Qt.createComponent("WorkflowView.qml")
                  var tab = rootTabs.addTab("New workflow", comp)
                  comp.statusChanged.connect(tabLoaded)
              }
          }
      }
  }
  </code></pre>
  
  <p>WorkflowEdit.qml:</p>
  
  <pre><code>Rectangle {
      TextField {
          id : nameInput
          text : modelData.name
          Binding {
              target : modelData
              property : "name"
              value : nameInput.text
          }
      }
  }
  </code></pre>