Is there a way not to modify the item model made with QStandardItemModel?

Asked 2 years ago, Updated 2 years ago, 91 views

I made a model for Treview with QStandardItemModel When I applied this model to the tree view, I could double-click the item to modify it Is there a way to prevent modification of the items in the model?

python pyside2

2022-09-21 12:26

1 Answers

You can set it up as below.

treeview.setEditTriggers(QAbstractItemView.NoEditTriggers)


2022-09-21 12:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.