title: What is the good way to lock/freeze columns in QTreeView
body: <p>I am trying to implement frozen (those that don't scroll when the rest of the grid is scrolled horizontally) columns in a <code>QTreeView</code> - just like in Excel.</p>
  
  <p>I tried to find some native Qt way to freeze columns, but the only thing I could find is a side-mention in <code>QAbstractScrollArea::setViewportMargins</code>, as mentioned in <a href="https://stackoverflow.com/questions/18053403/setviewportmargins-and-locked-rows-and-columns">this</a> post. So I followed the suggestion in the answer to the post and overlaid another QTreeView looking at the same model on top. I.e. now I have 2 QTreeViews, one only showing the frozen columns and the other showing the rest of the columns with horizontal scrolling. I have subclassed the full view, so that the user doesn't have to know about the frozen view and only work with the full view.</p>
  
  <p>However, now I am faced with a synchronization issue: all the changes made to the main view and its header need to be mirrored to the frozen view and its header respectively.
  E.g. if I call <code>mainView-&gt;header()-&gt;setStretchLastSection(false)</code>, the same call needs to be replicated on the frozen view's header. However, I have no notification when the method is called - DynamicPropertyChanged events are only called when <code>setProperty</code> is called and not when individual setter is.</p>
  
  <p>So, my questions are:</p>
  
  <ol>
  <li>Is there a way to implement frozen columns without having multiple views?</li>
  <li>How can I implement the synchronization between main and the frozen views, so that the frozen veiw would match everything done in the main view and its header?</li>
  </ol>
  
  <p>Thanks a lot!</p>