MCPcopy
hub / github.com/PyQt5/PyQt / DictBox

Class DictBox

Demo/Lib/qpropmapper.py:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36class DictBox(Box):
37 def keys(self, dotted: bool = False):
38 if not dotted:
39 return super().keys()
40
41 if not self._box_config["box_dots"]:
42 raise Exception(
43 "Cannot return dotted keys as this Box does not have `box_dots` enabled"
44 )
45
46 keys = set()
47 for key, value in self.items():
48 added = False
49 if isinstance(key, str):
50 if isinstance(value, Box):
51 for sub_key in value.keys(dotted=True):
52 keys.add(f"{key}.{sub_key}")
53 added = True
54 if not added:
55 keys.add(key)
56 return sorted(keys, key=lambda x: str(x))
57
58
59class QPropertyMapper(QObject):

Callers 2

loadDataMethod · 0.85
toDictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected