To the point: How do I get a QTreeWidgetItem to respect a QLineEdits setEchoMode(QLineEdit.Password) ?
I've been banging my head against the wall for this for the last day: I have a subclass of QTreeWidgetItem (which simply adds one extra field to the class)
I create an instance of it, add it to my TreeWidget:
twi = DIMTreeWidgetItem.DIMTreeWidgetItem(uuid.uuid4(), [field_name, '<Empty>'])
...
self.ui_instance.main_window.treeWidget.addTopLevelItem(twi)
I edit that an instance based on a double click of that item with:
self.ui_instance.main_window.treeWidget.editItem(item, column) This works fine.
I have a delegate attached to that column which is simply:
def __init__(self, parent=None, *args):
QStyledItemDelegate.__init__(self, parent, *args)
def createEditor(self, parent, option, index):
le = QLineEdit('', parent)
le.setEchoMode(QLineEdit.PasswordEchoOnEdit)
return le
But it seems this only effects the item during editing. What is the correct way for me to obscure the content of the treewidgetitem after editing?
Even if someone can shed some light on how to do this in C++, I'm sure I can translate it to pyside2