Cleaned up property-bag task panel and added support for editing the definition.

This commit is contained in:
Markus Lampert
2021-01-02 19:09:21 -08:00
parent 6dc60626da
commit a40522debd
4 changed files with 131 additions and 68 deletions

View File

@@ -45,17 +45,11 @@ SupportedPropertyType = {
'String' : 'App::PropertyString',
}
def getPropertyType(o):
if type(o) == str:
return SupportedPropertyType['String']
if type(o) == bool:
return SupportedPropertyType['Bool']
if type(o) == int:
return SupportedPropertyType['Integer']
if type(o) == float:
return SupportedPropertyType['Float']
if type(o) == FreeCAD.Units.Quantity:
return SupportedPropertyType[o.Unit.Type]
def getPropertyTypeName(o):
for typ in SupportedPropertyType:
if SupportedPropertyType[typ] == o:
return typ
raise IndexError()
class PropertyBag(object):
'''Property container object.'''