title: QT QItemSelectionModel to ignore columns?
body: <p>I am trying to restrict selection of a tree to a particular column. </p>
  
  <p>I am using delegates heavily to create custom per-item-per-column behaviors, editors, etc. I was hoping I could somehow do this from a delegate by blocking an event or something similar. The problem is, I think i would have to create an entirely custom solution that mimics extended selection. </p>
  
  <p>However, after a lot of searching and very few examples, it sounds like I want a custom QItemSelectionModel on my tree view. Is this assumption correct?</p>
  
  <p>How do I create a custom QItemSelectionModel that will use the Extended Selection Mode but allow me to ignore or revert a selection if not in a particular column. In other words, clicking on another column should not change the selection (should not select or deselect)</p>
  
  <p>I know how to add the selection model once I have it. I am asking for help implementing the derived class (unless this can be done with a connected signal).</p>
  
  <p>I am using Python, but would value any help.</p>
  
  <p>Thank you,</p>
  
  <p>[EDIT:] I found these similar questions:
  <a href="http://lists.qt.nokia.com/pipermail/qt-interest/2010-September/027647.html" rel="nofollow">http://lists.qt.nokia.com/pipermail/qt-interest/2010-September/027647.html</a></p>
  
  <p>"<strong>Subclass QItemSelectionModel and reimplement both select methods to have the 
  behaviour you want.</strong> Just ignore the parts of ranges with column > 0. 
  ...
  Or maybe just reimplement flags() to make the item not selectable. I don't 
  know if that will have any side effects."</p>
  
  <p>I tried reimplementing flags on my QTreeWidgetItem, but it never got called:</p>
  
  <pre><code>def flags(self, index):
      print index.column()
      return super(DDOutlinerBaseItem, self).flags(index)
  </code></pre>