Reference¶
-
class
TrivialUI.GenericProxy(data, children, parent=None, row=0)¶ The proxy object makes a single piece of Python data navigable in a tree context. This is the base class that uses Template Method to allow various different sorts of Python data to be navigated in this way.
-
hasChild(row)¶ Check whether this dict has an entry for the specified row. In fact, this just checks whether the number of entries in the collection is sufficient.
-
-
class
TrivialUI.DictProxy(data, children, parent=None, row=0)¶ Proxy object for making a dict of dicts navigable in a form usable by PyQt.
This gives nondeterministic ordering, unless you use an OrderedDict.
-
class
TrivialUI.ListModel(data, header=None)¶ A model object that exposes the model interface that Qt expects, based on a bunch of data provided as (possibly nested) Python list objects.
The tree structure itself is built up inside of the ListProxy object stored as self.root_item. The tree is constructed on the fly as Qt queries using the index() method.
-
TrivialUI.MainWindow¶ alias of
<Mock id='140603074489808'>
-
class
TrivialUI.TextEdit(name)¶ Proxy class for creating a QLineEdit. This has to be a distinct class for two reasons:
- It’s used in static initialisation when creating a MainWindow class, so it ends up being constructed before the Qt application is ready.
- Similarly, it’s used statically where we actually want multiple instances to be created when the MainWindow is created.