[PyQt] setEditTriggers

Scott Frankel frankel at circlesfx.com
Sun Jul 20 02:19:22 BST 2008


Hello,

How does one allow the fields of a tree to be editable?

I've read that items of a tree widget are not editable by default.    
By setting setEditTriggers(), one can control editability.  That gets  
set on the view, right?  I've got a pure model that the view gets set  
to.  Is there something I need to do there as well?

Here's a portion of my view code:

		self.theView = QtGui.QTreeView()
		self.theView.setEditTriggers(QtGui.QTreeView.DoubleClicked)
		self.theView.setSelectionBehavior(QtGui.QTreeView.SelectItems)
		self.theView.setUniformRowHeights(True)
		self.theView.setAlternatingRowColors(True)

Double-clicking on a field just opens/closes that tree branch's  
nesting.  Setting the edit triggers to AllEditTriggers yields the same  
results:  no editability.

Thanks in advance!
Scott










More information about the PyQt mailing list