From 108aed569e7ce4630e6ab4c8f1647284883a9f30 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 17 Nov 2015 22:53:11 +0800 Subject: [PATCH] gui/models/DictSyncTreeSepModel: add getitem --- artiq/gui/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/artiq/gui/models.py b/artiq/gui/models.py index a46f5dd38..6b859adb0 100644 --- a/artiq/gui/models.py +++ b/artiq/gui/models.py @@ -331,6 +331,11 @@ class DictSyncTreeSepModel(QtCore.QAbstractItemModel): self._del_item(self, k.split(self.separator)) 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): item = index.internalPointer() if item.children_by_row: