class documentation

class TreeModelMixinBase(ConnectorMixin): (source)

Known subclasses: zim.notebook.index.pages.PagesTreeModelMixin

View In Hierarchy

This class can be used as mixin class for Gtk.TreeModel implementations that use data from the index.

Treepaths are simply tuples with integers. This Mixin assumes MyTreeIter objects for iters. (Which should not be confused with Gtk.TreeIter as used by the interface!)

Method __init__ Undocumented
Method connect_to_updateiter Connect to a new IndexUpdateIter
Method find Return the treepath for a index object like a Path or IndexTag @raises IndexNotFoundError: if indexpath is not found @implementation: must be implemented by a subclass
Method find_all Like find() but can return multiple results @implementation: must be implemented by subclasses that have mutiple entries for the same object. Default falls back to result of find().
Method get_mytreeiter Returns a treeiter object for treepath or None @implementation: must be implemented by a subclass
Method n_children_top Return the number of items in the top level of the model
Method teardown Undocumented
Instance Variable cache Undocumented
Instance Variable db Undocumented
Instance Variable index Undocumented

Inherited from ConnectorMixin:

Method connectto Connect to signals of another object E.g.:
Method connectto_all Convenience method to combine multiple calls to connectto().
Method disconnect_all Disconnect all signals that have been connected with connectto and friends. Typically called when you want to destroy this object.
Method disconnect_from Disc all signals that have been connected with connectto and friends to a specific object.
Method _disconnect_from Undocumented
Instance Variable _connected_signals Undocumented
def __init__(self, index): (source)
def connect_to_updateiter(self, update_iter): (source)

Connect to a new IndexUpdateIter

The following signals must be implemented:

  • row-inserted (treepath, treeiter)
  • row-changed (treepath, treeiter)
  • row-has-child-toggled (treepath, treeiter)
  • row-deleted (treepath)

Typically each signal should also flush the cache using self.cache.clear().

Unknown Field: implementation
must be implemented by a subclass
def find(self, obj): (source)
Return the treepath for a index object like a Path or IndexTag
Raises
IndexNotFoundErrorif indexpath is not found
Unknown Field: implementation
must be implemented by a subclass
def find_all(self, obj): (source)
Like find() but can return multiple results
Unknown Field: implementation
must be implemented by subclasses that have mutiple entries for the same object. Default falls back to result of find().
def get_mytreeiter(self, treepath): (source)
Returns a treeiter object for treepath or None
Unknown Field: implementation
must be implemented by a subclass
def n_children_top(self): (source)
Return the number of items in the top level of the model
def teardown(self): (source)

Undocumented

cache: dict = (source)

Undocumented

Undocumented

index = (source)

Undocumented