forked from M-Labs/artiq
1
0
Fork 0

gui/models/DictSyncTreeSepModel: add getitem

This commit is contained in:
Sebastien Bourdeauducq 2015-11-17 22:53:11 +08:00
parent 537fa2287b
commit 108aed569e
1 changed files with 5 additions and 0 deletions

View File

@ -331,6 +331,11 @@ class DictSyncTreeSepModel(QtCore.QAbstractItemModel):
self._del_item(self, k.split(self.separator)) self._del_item(self, k.split(self.separator))
del self.backing_store[k] del self.backing_store[k]
def __getitem__(self, k):
def update():
self[k] = self.backing_store[k]
return _SyncSubstruct(update, self.backing_store[k])
def index_to_key(self, index): def index_to_key(self, index):
item = index.internalPointer() item = index.internalPointer()
if item.children_by_row: if item.children_by_row: