title: List of items with QML and PyQt
body: <p>I want to create a simple list of GUI elements arranged in a list using PyQt + QML approach. Elements represent projects with two main properties: <code>name</code> and <code>state</code>. Initially the list is filling with some in-code objects, for example from the QT settings storage. The thing is, I want to wrap every entry retrieved from the storage in my class (dedicated module). In pseudo-code:</p>
  
  <pre class="lang-py prettyprint-override"><code>from my_module import Project
  
  initial_list = [{
      name: 'Spaceship',
      state: 'In progress'
  }, {
      name: 'Aircraft',
      state: 'Done'
  }, {
      name: 'Truck',
      state: 'Broken'
  }]
  
  projects = [Project(p) for p in initial_list]
  </code></pre>
  
  <p>User can click on the item and perform some tasks with it (thats why I want the element to be a <code>Project</code> instance).</p>
  
  <p>I understand that I should have a model representing the data but I struggle with the scattered examples I found. Should I have a model of the single element as well as the whole list model? How to encapsulate a <code>Project</code> instance in a <code>QObject</code> subclass? My last tries were <code>QAbstractListModel</code> to use as a model and <code>ListView</code> to use as a visual representation. Can you provide me a minimal complete example?</p>