spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item

Classes to represent tool and feature items in a tree.

authors
  1. Marin (KTH)

date

1.9.2020

Module Contents

Classes

FeatureRootItem

A feature root item.

ToolRootItem

A tool root item.

FeatureLeafItem

A feature leaf item.

ToolLeafItem

A tool leaf item.

ToolFeatureRootItem

A tool_feature root item.

ToolFeatureLeafItem

A tool feature leaf item.

ToolFeatureRequiredItem

A tool feature required item.

ToolFeatureMethodRootItem

A tool_feature_method root item.

ToolFeatureMethodLeafItem

A tool_feature_method leaf item.

Attributes

_FEATURE_ICON

_TOOL_ICON

_METHOD_ICON

spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item._FEATURE_ICON = [source]
spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item._TOOL_ICON = [source]
spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item._METHOD_ICON = [source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.FeatureRootItem(model=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EmptyChildRootItem

A feature root item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property display_data(self)[source]
property icon_code(self)[source]
empty_child(self)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolRootItem(model=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EmptyChildRootItem

A tool root item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property display_data(self)[source]
property icon_code(self)[source]
empty_child(self)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.FeatureLeafItem(identifier=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LastGrayMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EditableMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LeafItem

A feature leaf item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
_make_item_data(self)[source]
property item_data(self)[source]
property tool_tip(self)[source]
add_item_to_db(self, db_item)[source]
update_item_in_db(self, db_item)[source]
flags(self, column)[source]

Makes items editable.

_make_item_to_add(self, value)[source]
_make_item_to_update(self, column, value)[source]
_get_ids_from_feat_name(self, feature_name)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolLeafItem(identifier=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LastGrayMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EditableMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LeafItem

A tool leaf item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
add_item_to_db(self, db_item)[source]
update_item_in_db(self, db_item)[source]
fetch_more(self)[source]

Fetches more children.

class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolFeatureRootItem(model=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.RootItem

A tool_feature root item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property display_data(self)[source]
property tool_tip(self)[source]
property icon_code(self)[source]
property feature_id_list(self)[source]
flags(self, column)[source]

Enables the item and makes it selectable.

class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolFeatureLeafItem(identifier=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LeafItem

A tool feature leaf item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property item_data(self)[source]
fetch_more(self)[source]

Fetches more children.

abstract add_item_to_db(self, db_item)[source]
update_item_in_db(self, db_item)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolFeatureRequiredItem(model=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyTreeItem

A tool feature required item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
flags(self, column)[source]

Enables the item and makes it selectable.

data(self, column, role=Qt.DisplayRole)[source]

Returns data for given column and role.

set_data(self, column, value, role=Qt.EditRole)[source]

Sets data for this item.

Parameters
  • column (int) – column index

  • value (object) – a new value

  • role (int) – role of the new value

Returns

True if data was set successfully, False otherwise

Return type

bool

class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolFeatureMethodRootItem(model=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EmptyChildRootItem

A tool_feature_method root item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property display_data(self)[source]
property icon_code(self)[source]
empty_child(self)[source]
class spinetoolbox.spine_db_editor.mvcmodels.tool_feature_item.ToolFeatureMethodLeafItem(identifier=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LastGrayMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LeafItem

A tool_feature_method leaf item.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property tool_feature_item(self)[source]
property item_data(self)[source]
_make_item_data(self)[source]
flags(self, column)[source]

Enables the item and makes it selectable.

_make_item_to_add(self, value)[source]
_make_item_to_update(self, column, value)[source]
_get_method_index(self, parameter_value_list_id, method)[source]
add_item_to_db(self, db_item)[source]
update_item_in_db(self, db_item)[source]