This commit is contained in:
yumoqing 2021-06-10 10:56:34 +08:00
parent 940171bf9d
commit 4f221b1933

View File

@ -310,6 +310,7 @@ class Blocks(EventDispatcher):
for k,v in [(k,v) for k,v in desc.items() if k not in excludes]: for k,v in [(k,v) for k,v in desc.items() if k not in excludes]:
if isinstance(v,dict) and v.get('widgettype'): if isinstance(v,dict) and v.get('widgettype'):
b = Blocks() b = Blocks()
v = self.valueExpr(v, localnamespace={'self':widget})
w = b.w_build(v) w = b.w_build(v)
if hasattr(widget,k): if hasattr(widget,k):
aw = getattr(widget,k) aw = getattr(widget,k)
@ -327,7 +328,8 @@ class Blocks(EventDispatcher):
pos = 0 pos = 0
for pos,sw in enumerate(desc.get('subwidgets',[])): for pos,sw in enumerate(desc.get('subwidgets',[])):
b = Blocks() b = Blocks()
kw = sw.copy() kw = self.valueExpr(sw.copy(),
localnamespace={'self':widget})
w = b.widgetBuild(kw) w = b.widgetBuild(kw)
widget.add_widget(w) widget.add_widget(w)