I have a QTreeWidget that can have many rows but only 3 columns:
In the picture I have selected my last column. What I would like to do, is to disable the last column for every item in the tree UNLESS it is selected. So in my situation only the pidtest.xml
item would have enabled checkbox. How can I do this with existing methods?
Here you have a complete working example on how to do that.
As Pavel Strakhov have pointed out, the example use a QTreeView, since QTreeWidgetItem do not support "partial disabling".
In the example a TreeView is displayed, showing 2 columns (name, enabled). You will be able to edit the first column only if the second is true.
Complete example: