project_item

ProjectItem class.

authors:
  1. Savolainen (VTT)
date:

4.10.2018

Module Contents

class project_item.ProjectItem(name, description, is_root=False, is_category=False)[source]

Bases: metaobject.MetaObject

Base class for all project items. Create root and category items by instantiating objects from this class.

name

Object name

Type:str
description

Object description

Type:str
is_root

True if new item should be a root item

Type:bool
is_category

True if new item should be a category item

Type:bool
parent(self)[source]

Returns parent project item.

child_count(self)[source]

Returns the number of child project items for this object.

children(self)[source]

Returns the children of this project item.

child(self, row)[source]

Returns child ProjectItem on given row.

Parameters:row (int) – Row of child to return
Returns:ProjectItem on given row or None if it does not exist
row(self)[source]

Returns the row on which this project item is located.

add_child(self, child_item)[source]

Append child project item as the last item in the children list. Set parent of this items parent as this item. This method is called by ProjectItemModel when new items are added.

Parameters:child_item (ProjectItem) – Project item to add
Returns:True if operation succeeded, False otherwise
remove_child(self, row)[source]

Remove the child of this ProjectItem from given row. Do not call this method directly. This method is called by ProjectItemModel when items are removed.

Parameters:row (int) – Row of child to remove
Returns:True if operation succeeded, False otherwise
connect_signals(self)[source]

Connect signals to handlers.

disconnect_signals(self)[source]

Disconnect signals from handlers and check for errors.