miniminic
(miniminic)
September 1, 2022, 6:11am
1
I created an extension, I want to make nameColumn uneditable, how should i do
lassoan
(Andras Lasso)
September 2, 2022, 3:37am
2
You can use standard Qt API to make items non-editable. Maybe you can try clearing the Qt::ItemIsEditable flag in the tree view item.
miniminic
(miniminic)
September 2, 2022, 6:24am
3
thanks, I rewrote the qMRMLSubjectHierarchyModel: : subjectHierarchyItemFlags method implements this function, but I don’t know where the model set to the treeview is correct
lassoan
(Andras Lasso)
September 3, 2022, 12:30pm
4
It looks good. Just to improve style and readability, I would add handle the editable flag in a separate if branch.