spinetoolbox.mvcmodels.parameter_value_list_model

A tree model for parameter value lists.

authors:
  1. Marin (KTH)
date:

28.6.2019

Module Contents

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

Makes items editable.

class spinetoolbox.mvcmodels.parameter_value_list_model.GrayFontMixin[source]

Paints the text gray.

data(self, column, role=Qt.DisplayRole)[source]
class spinetoolbox.mvcmodels.parameter_value_list_model.BoldFontMixin[source]

Bolds text.

data(self, column, role=Qt.DisplayRole)[source]
class spinetoolbox.mvcmodels.parameter_value_list_model.AppendEmptyChildMixin[source]

Provides a method to append an empty child if needed.

append_empty_child(self, row)[source]

Append empty child if the row is the last one.

class spinetoolbox.mvcmodels.parameter_value_list_model.DBItem(db_map)[source]

Bases: spinetoolbox.mvcmodels.parameter_value_list_model.AppendEmptyChildMixin, spinetoolbox.mvcmodels.minimal_tree_model.TreeItem

An item representing a db.

Init class.

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

Shows Spine icon for fun.

class spinetoolbox.mvcmodels.parameter_value_list_model.ListItem(db_map, identifier=None, name=None, value_list=())[source]

Bases: spinetoolbox.mvcmodels.parameter_value_list_model.GrayFontMixin, spinetoolbox.mvcmodels.parameter_value_list_model.BoldFontMixin, spinetoolbox.mvcmodels.parameter_value_list_model.AppendEmptyChildMixin, spinetoolbox.mvcmodels.parameter_value_list_model.EditableMixin, spinetoolbox.mvcmodels.minimal_tree_model.TreeItem

A list item.

db_mngr[source]
fetch_more(self)[source]
compile_value_list(self)[source]
empty_child(self)[source]
data(self, column, role=Qt.DisplayRole)[source]
set_data(self, column, name)[source]
set_child_data(self, child, value)[source]
update_name_in_db(self, name)[source]
update_value_list_in_db(self, child, value)[source]
add_to_db(self)[source]

Add item to db.

handle_updated_in_db(self, name, value_list)[source]

Runs when an item with this id has been updated in the db.

handle_added_to_db(self, identifier, value_list)[source]

Runs when the item with this name has been added to the db.

reset_value_list(self, value_list)[source]
class spinetoolbox.mvcmodels.parameter_value_list_model.ValueItem(value=None)[source]

Bases: spinetoolbox.mvcmodels.parameter_value_list_model.GrayFontMixin, spinetoolbox.mvcmodels.parameter_value_list_model.EditableMixin, spinetoolbox.mvcmodels.minimal_tree_model.TreeItem

A value item.

data(self, column, role=Qt.DisplayRole)[source]
set_data(self, column, value)[source]
class spinetoolbox.mvcmodels.parameter_value_list_model.ParameterValueListModel(parent, db_mngr, *db_maps)[source]

Bases: spinetoolbox.mvcmodels.minimal_tree_model.MinimalTreeModel

A model to display parameter value list data in a tree view.

Parameters:

Initialize class

remove_selection_requested[source]
remove_icon[source]
receive_parameter_value_lists_added(self, db_map_data)[source]
receive_parameter_value_lists_updated(self, db_map_data)[source]
receive_parameter_value_lists_removed(self, db_map_data)[source]
build_tree(self)[source]

Initialize the internal data structure of the model.

columnCount(self, parent=QModelIndex())[source]

Returns the number of columns under the given parent. Always 1.