![]() |
HAL
|
(Future) Base class for all tree models related to the details widget. More...
#include <base_tree_item.h>
Public Member Functions | |
BaseTreeItem () | |
BaseTreeItem (QList< QVariant > columnData) | |
virtual | ~BaseTreeItem () |
virtual QVariant | getData (int column) const =0 |
virtual void | setData (QList< QVariant > data)=0 |
virtual void | setDataAtIndex (int index, QVariant &data)=0 |
virtual void | appendData (QVariant data)=0 |
virtual BaseTreeItem * | getParent () const |
virtual void | setParent (BaseTreeItem *parent) |
virtual BaseTreeItem * | getChild (int row) const |
virtual QList< BaseTreeItem * > | getChildren () const |
virtual void | appendChild (BaseTreeItem *child) |
virtual void | insertChild (int index, BaseTreeItem *child) |
virtual BaseTreeItem * | removeChildAtPos (int row) |
virtual bool | removeChild (BaseTreeItem *child) |
virtual int | getChildCount () const |
virtual int | getColumnCount () const =0 |
virtual int | getRowForChild (const BaseTreeItem *child) const |
virtual int | getOwnRow () |
Protected Attributes | |
BaseTreeItem * | mParent |
QList< BaseTreeItem * > | mChildren |
(Future) Base class for all tree models related to the details widget.
This class functions as a generic data container for all tree models.
Definition at line 40 of file base_tree_item.h.
hal::BaseTreeItem::BaseTreeItem | ( | ) |
The constructor.
Definition at line 6 of file base_tree_item.cpp.
Second constructor to immediately assign column data.
columnData | - The item's data. |
|
virtual |
|
virtual |
Appends a child.
child | - The child to append. |
Definition at line 39 of file base_tree_item.cpp.
References mChildren, and setParent().
Referenced by hal::ContextTreeModel::addContext(), hal::ContextTreeModel::addDirectory(), hal::ModuleItem::appendExistingChildIfAny(), hal::ModuleModel::createChildItem(), hal::ModuleModel::populateFromGatelist(), hal::ModuleModel::populateTree(), hal::BaseTreeModel::setContent(), hal::GatePinsTreeModel::setGate(), hal::PinModel::setGate(), hal::ModulePinsTreeModel::setModule(), and hal::ModuleModel::updateModuleParent().
|
pure virtual |
Appends a new column to the item.
data | - The data of the new column. |
Implemented in hal::PortTreeItem, hal::PinTreeItem, hal::PinItem, hal::ModuleItem, hal::ContextTreeItem, and hal::RootTreeItem.
|
virtual |
Get the child of a specific row.
row | - The requested row. |
Definition at line 29 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::BaseTreeModel::index().
|
virtual |
Get the number of children.
Definition at line 75 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::ContextTreeModel::addContext(), hal::ContextTreeModel::addDirectory(), hal::BaseTreeModel::clear(), hal::ModuleModel::createChildItem(), hal::ActionDeleteObject::exec(), hal::ModulePinsTreeModel::getNetFromItem(), hal::BaseTreeModel::insertChildItem(), hal::ModuleModel::removeChildItem(), hal::BaseTreeModel::rowCount(), and hal::ModuleModel::updateModuleParent().
|
virtual |
Get the list of all children.
Definition at line 34 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::ContextTreeModel::getChildContextsOf(), hal::ContextTreeModel::getChildDirectoriesOf(), hal::PinModel::getInputPins(), hal::PinModel::getOutputPins(), hal::PinModel::getPinGroups(), hal::GatePinTree::handleContextMenuRequested(), hal::FlipFlopWizardPage::initializePage(), hal::PinsWizardPage::isComplete(), hal::ModuleModel::removeChildItem(), and hal::ContextTreeModel::removeDirectory().
|
pure virtual |
Get the number of currently stored column data.
Implemented in hal::PortTreeItem, hal::PinTreeItem, hal::PinItem, hal::ModuleItem, hal::ContextTreeItem, and hal::RootTreeItem.
|
pure virtual |
Get the data of a specific column (most in the form of a string).
column | - The requested column. |
Implemented in hal::PortTreeItem, hal::PinTreeItem, hal::PinItem, hal::ModuleItem, hal::ContextTreeItem, and hal::RootTreeItem.
Referenced by hal::BaseTreeModel::data().
|
virtual |
Convenience method to get the row of this item within the parent's list. If the item has no parent, -1 is returned.
Definition at line 94 of file base_tree_item.cpp.
References getRowForChild(), and mParent.
Referenced by hal::ModulePinsTreeModel::canDropMimeData(), hal::ModuleModel::removeChildItem(), and hal::ModuleModel::updateModuleParent().
|
virtual |
Get the item's parent.
Definition at line 19 of file base_tree_item.cpp.
References mParent.
Referenced by hal::ContextProxyModel::canDropMimeData(), hal::ActionMoveItem::exec(), hal::BaseTreeModel::getIndexFromItem(), hal::GraphContextManager::getParentId(), hal::GraphContextManager::handleSaveTriggered(), hal::ContextProxyModel::mimeData(), hal::ModuleModel::mimeData(), hal::ModuleModel::moduleAssignGate(), hal::GuiApiClasses::View::moveDirectory(), hal::ContextTreeModel::moveItem(), hal::GuiApiClasses::View::moveView(), hal::BaseTreeModel::parent(), hal::ContextTreeModel::removeContext(), hal::ContextTreeModel::removeDirectory(), hal::ModuleModel::removeGate(), hal::ModuleModel::removeModule(), hal::ModuleModel::removeNet(), hal::ContextTreeItem::row(), hal::PinItem::row(), hal::ContextTreeModel::setCurrentDirectory(), hal::ModuleModel::updateModuleParent(), and hal::ModuleModel::updateNetParent().
|
virtual |
Convenience method to get the row for a given item. If the item is not a child of this item, -1 is returned.
child | - The child for which the row is requested. |
Definition at line 80 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::BaseTreeModel::getIndexFromItem(), getOwnRow(), hal::ContextTreeItem::row(), and hal::PinItem::row().
|
virtual |
Inserts a child at the given index. If the index exceeds the amount of children, the new child is appended.
index | - The position at which to insert. |
child | - The child to insert. |
Definition at line 45 of file base_tree_item.cpp.
References mChildren, and setParent().
Referenced by hal::BaseTreeModel::insertChildItem().
|
virtual |
Removes the given item and returns True if removing was successful or False if the given item was no child.
child | - The child to remove. |
Definition at line 63 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::PinModel::handleDeleteItem(), hal::ContextTreeModel::moveItem(), hal::ModuleModel::removeChildItem(), and hal::ModuleModel::updateModuleParent().
|
virtual |
Removes the child at the given row and returns it.
row | - The row from which to remove the child. |
Definition at line 51 of file base_tree_item.cpp.
References mChildren.
Referenced by hal::BaseTreeModel::clear().
Sets the data for all columns.
data | - Each entry in the list represents one column. |
Implemented in hal::PortTreeItem, hal::PinTreeItem, hal::PinItem, hal::ModuleItem, hal::ContextTreeItem, and hal::RootTreeItem.
|
pure virtual |
Sets the data for a specified column. The index must be within already existing boundaries (for example, add dummy data beforehand).
index | - The column to set the new data. |
data | - The new column data. |
Implemented in hal::PortTreeItem, hal::PinTreeItem, hal::PinItem, hal::ModuleItem, hal::ContextTreeItem, and hal::RootTreeItem.
|
virtual |
Sets the item's parent.
parent | - The parent. |
Definition at line 24 of file base_tree_item.cpp.
References mParent.
Referenced by appendChild(), hal::ModuleItem::appendExistingChildIfAny(), and insertChild().
|
protected |
Definition at line 194 of file base_tree_item.h.
Referenced by appendChild(), getChild(), getChildCount(), getChildren(), getRowForChild(), insertChild(), removeChild(), removeChildAtPos(), and ~BaseTreeItem().
|
protected |
Definition at line 193 of file base_tree_item.h.
Referenced by getOwnRow(), getParent(), hal::ModuleItem::isToplevelItem(), and setParent().