rename Model to DictModel + augment API

* add "update" and "reset" methods
* core: no more default keyAttrName
* qt: if keyAttrName is empty, don't register items in internal dictionnary
This commit is contained in:
Yann Lanthony 2017-10-23 17:16:22 +02:00
parent 9c7d0c1b1c
commit 1e306f8408
5 changed files with 42 additions and 13 deletions

View file

@ -1,6 +1,7 @@
import meshroom
Model = None
DictModel = None
Slot = None
Signal = None
Property = None
@ -9,10 +10,10 @@ Variant = None
if meshroom.backend == meshroom.Backend.PYSIDE:
# PySide types
from .qt import Model, Slot, Signal, Property, BaseObject, Variant
from .qt import DictModel, Slot, Signal, Property, BaseObject, Variant
elif meshroom.backend == meshroom.Backend.STANDALONE:
# Core types
from .core import Model, Slot, Signal, Property, BaseObject, Variant
from .core import DictModel, Slot, Signal, Property, BaseObject, Variant
class _BaseModel:
@ -48,3 +49,11 @@ class _BaseModel:
def clear(self):
""" Remove all internal objects """
pass
def update(self, d):
""" Combine dict 'd' with self """
pass
def reset(self, d):
""" Reset model with given values """
pass