title: Editing QTreeView items when each tier have different item type
body: <p>I'm doing a character animation editor.</p>
  
  <p>My character is represented in a QTreeView like this</p>
  
  <ul>
   <li>
   Character
   <ul>
    <li>
     Animation 0
     <ul>
      <li>Frame 0</li>
      <li>Frame 1</li>
      <li>Frame 2</li>
     </ul>
    </li>
    <li>
     Animation 1
     <ul>
      <li>Frame 3</li>
      <li>Frame 4</li>
      <li>Frame 5</li>
     </ul>
    </li>
   </ul>
   </li>
  </ul>
  
  <p>And etc.</p>
  
  <p>There is a basic abstract <code>Item</code> class that <code>Character</code>, <code>Animation</code> and <code>Frame</code> inherits from.</p>
  
  <p>The restrictions are:</p>
  
  <ul>
  <li><code>Character</code> items can have any number of ONLY <code>Animation</code> items</li>
  <li><code>Animations</code> items can have any number of ONLY <code>Frame</code> items</li>
  <li><code>Frame</code> items can not have any children</li>
  </ul>
  
  <p>Now, everything that inherits from <code>Item</code> have a name. Then every type of item adds its own attributes (<code>Animation</code> can have Wrap mode, FPS; <code>Frame</code> can have duration).</p>
  
  <p>So each level of the tree has different data set.</p>
  
  <p>Now I want to add another widget that allows editing the data of each <code>Item</code>. The widget will be broken into 3 parts (sections): Data related to character, data related to animation and data related to frame.
  When the user selects an item in the tree, the widget will autofill itself according to the following rules:</p>
  
  <ol>
  <li>If selected item is <code>Character</code> => Fill only character section</li>
  <li>If selected item is <code>Animation</code> => Fill the animation section + do step <code>1</code> with the character that is the parent of this animation</li>
  <li>If selected item is <code>Frame</code> => Fill the frame section + do step <code>2</code> with the animation that is the parent of this frame</li>
  </ol>
  
  <p>I can distinguish between selected items (I can tell if it either Character, Animation of Frame). I can access the parent item from the selected child.</p>
  
  <p>My problem is that I don't know how to map the data between my tree's model and the editing widgets. I looked into QDataWidgetMapper but it does not help, it looks like it works on models that have the same item, while my model have different items per level.</p>
  
  <p>I might have a major design flaw, or I simply don't know how to achieve what I'm trying to implement.</p>
  
  <p>I'd like some guidance.</p>
  
  <p>P.S.</p>
  
  <p>Here is an image of the main screen hierarchy and the 3 sections
  <img src="https://i.stack.imgur.com/sGEXI.png" alt="dmut hierarchy and section editing"></p>