spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility

A tree model for parameter_value lists.

authors:
  1. Marin (KTH)
date:

28.6.2019

Module Contents

Classes

NonLazyTreeItem A tree item that fetches their children as they are inserted.
EditableMixin
LastGrayMixin Paints the last item gray.
AllBoldMixin Bolds text.
EmptyChildMixin Guarantess there’s always an empty child.
NonLazyDBItem An item representing a db.
class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyTreeItem(model=None)[source]

Bases: spinetoolbox.mvcmodels.minimal_tree_model.TreeItem

A tree item that fetches their children as they are inserted.

Initializes item.

Parameters:model (MinimalTreeModel, NoneType) – The model where the item belongs.
item_type[source]
db_mngr[source]
can_fetch_more(self)[source]

Disables lazy loading by returning False.

insert_children(self, position, *children)[source]

Fetches the children as they become parented.

class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EditableMixin[source]
flags(self, column)[source]

Makes items editable.

class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LastGrayMixin[source]

Paints the last item gray.

data(self, column, role=Qt.DisplayRole)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.AllBoldMixin[source]

Bolds text.

data(self, column, role=Qt.DisplayRole)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EmptyChildMixin[source]

Guarantess there’s always an empty child.

empty_child(self)[source]
fetch_more(self)[source]
append_empty_child(self, row)[source]

Appends empty child if the row is the last one.

class spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyDBItem(db_map)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyTreeItem

An item representing a db.

Init class.

Args
db_mngr (SpineDBManager) db_map (DiffDatabaseMapping)
item_type[source]
data(self, column, role=Qt.DisplayRole)[source]

Shows Spine icon for fun.

set_data(self, column, value, role)[source]

See base class.