frankel at circlesfx.com
Sun Jul 20 05:45:28 BST 2008
Problem found: I needed to implement flags() and setData() in my
model. I knew it was going to be something I overlooked.
- What's the proper way to implement setData() for a tree model? I've
extended QAbstractItemModel with methods that add branches and leaves
to populate the tree in the first place. Does setData() call them
again? Yes, I'm puzzled ;)
- How can flags() be coaxed to make only one column's fields editable?
I'm on to exploring delegates next, to give my editable tree fields
Thanks in advance (again)! Still wrapping my head around MVC tree
On Jul 19, 2008, at 6:19 PM, Scott Frankel wrote:
> 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()
> 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!
> PyQt mailing list PyQt at riverbankcomputing.com
More information about the PyQt