I would like to post a memorandum and correction. I wrote a Styled Item Delegate that rewrote the C ++ example. ReadOnlyStyledItemDelegate.
ReadOnlyStyledItemDelegate.py
from PySide2.QtWidgets import QStyledItemDelegate
class ReadOnlyStyledItemDelegate(QStyledItemDelegate):
def __init__(self, parent=None):
super().__init__(parent)
def createEditor(self, parent, option, index):
return None
I think that the non-updatable of specific columns is a necessary function in practice. Since the C ++ example returns null, isn't it okay to use None? I wrote it with an understanding of that. Since it is not possible to create, the function after delegate should be implemented can be left to the parent, so only createEditor.
Recommended Posts