umbrello 2.39.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
UMLListViewItem Class Reference

Items used by UMLListView. More...

`#include <umllistviewitem.h>`

Inheritance diagram for UMLListViewItem:

## Public Types
enum | ListViewType { lvt_Min = 799 , lvt_View = 800 , lvt_Logical_View , lvt_UseCase_View , lvt_Logical_Folder , lvt_UseCase_Folder , lvt_UseCase_Diagram , lvt_Collaboration_Diagram , lvt_Class_Diagram , lvt_State_Diagram , lvt_Activity_Diagram , lvt_Sequence_Diagram , lvt_Actor , lvt_UseCase , lvt_Class , lvt_Attribute , lvt_Operation , lvt_Template , lvt_Interface , lvt_Package , lvt_Component_Diagram , lvt_Component_Folder , lvt_Component_View , lvt_Component , lvt_Diagrams , lvt_Artifact , lvt_Deployment_Diagram , lvt_Deployment_Folder , lvt_Deployment_View , lvt_Node , lvt_Datatype , lvt_Datatype_Folder , lvt_Enum , lvt_Entity , lvt_EntityAttribute , lvt_EntityRelationship_Diagram , lvt_EntityRelationship_Folder , lvt_EntityRelationship_Model , lvt_Subsystem , lvt_Model , lvt_EnumLiteral , lvt_UniqueConstraint , lvt_PrimaryKeyConstraint , lvt_ForeignKeyConstraint , lvt_CheckConstraint , lvt_Category , lvt_Port , lvt_Properties , lvt_Properties_AutoLayout , lvt_Properties_Class , lvt_Properties_CodeGeneration , lvt_Properties_CodeImport , lvt_Properties_CodeViewer , lvt_Properties_Font , lvt_Properties_General , lvt_Properties_UserInterface , lvt_Association , lvt_Object_Diagram , lvt_Instance , lvt_InstanceAttribute , lvt_Max , lvt_Unknown = -1 }

## Public Slots
void | slotEditFinished (const QString &newText)

## Public Member Functions
| UMLListViewItem (UMLListView *parent, const QString &name, ListViewType t, UMLObject *o=0)
| UMLListViewItem (UMLListView *parent)
| UMLListViewItem (UMLListViewItem *parent)
| UMLListViewItem (UMLListViewItem *parent, const QString &name, ListViewType t, UMLObject *o=0)
| UMLListViewItem (UMLListViewItem *parent, const QString &name, ListViewType t, Uml::ID::Type id)
ListViewType | type () const
void | setID (Uml::ID::Type id)
Uml::ID::Type | ID () const
void | setUMLObject (UMLObject *obj)
UMLObject * | umlObject () const
bool | isOwnParent (Uml::ID::Type listViewItemID)
void | updateObject ()
void | updateFolder ()
void | setText (int column, const QString &text)
void | setText (const QString &text)
QString | getSavedText () const
void | setVisible (bool state)
QString | toolTip () const
void | setIcon (Icon_Utils::IconType iconType)
void | addChildItem (UMLObject *child, UMLListViewItem *childItem)
void | deleteChildItem (UMLObject *child)
UMLListViewItem * | deepCopy (UMLListViewItem *newParent)
UMLListViewItem * | findUMLObject (const UMLObject *o)
UMLListViewItem * | findChildObject (const UMLObject *child)
UMLListViewItem * | findItem (Uml::ID::Type id)
UMLListViewItem * | childItem (int i)
void | saveToXMI (QXmlStreamWriter &writer)
bool | loadFromXMI (QDomElement &qElement)
bool | isOpen () const
void | setOpen (bool state)

## Static Public Member Functions
static QString | toString (ListViewType type)
static void | deleteItem (UMLListViewItem *childItem)

## Protected Types
typedef QHash< const UMLObject *, UMLListViewItem * > | ChildObjectMap

## Protected Member Functions
void | init ()
void | cancelRenameWithMsg ()
UMLListViewItem * | findUMLObject_r (const UMLObject *o)

## Protected Attributes
ListViewType | m_type
Uml::ID::Type | m_id
QPointer< UMLObject > | m_object
QString | m_label

## Static Protected Attributes
static ChildObjectMap * | s_comap

## Detailed Description

Items used by UMLListView.

Items used by the class UMLListView. This is needed as the type and object information is required to be stored.

Author
  Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m

See also
  UMLListView Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

## Member Typedef Documentation

## ◆ ChildObjectMap

typedef QHash<const UMLObject*, UMLListViewItem*> UMLListViewItem::ChildObjectMap
| protected

Auxiliary map of child UMLListViewItems keyed by UMLObject. Used by findChildObject() for efficiency instead of looping using firstChild()/nextSibling() because the latter incur enforceItemVisible() and thus expensive sorting.

## Member Enumeration Documentation

## ◆ ListViewType

enum UMLListViewItem::ListViewType

Enumerator
lvt_Min |
lvt_View |
lvt_Logical_View |
lvt_UseCase_View |
lvt_Logical_Folder |
lvt_UseCase_Folder |
lvt_UseCase_Diagram |
lvt_Collaboration_Diagram |
lvt_Class_Diagram |
lvt_State_Diagram |
lvt_Activity_Diagram |
lvt_Sequence_Diagram |
lvt_Actor |
lvt_UseCase |
lvt_Class |
lvt_Attribute |
lvt_Operation |
lvt_Template |
lvt_Interface |
lvt_Package |
lvt_Component_Diagram |
lvt_Component_Folder |
lvt_Component_View |
lvt_Component |
lvt_Diagrams |
lvt_Artifact |
lvt_Deployment_Diagram |
lvt_Deployment_Folder |
lvt_Deployment_View |
lvt_Node |
lvt_Datatype |
lvt_Datatype_Folder |
lvt_Enum |
lvt_Entity |
lvt_EntityAttribute |
lvt_EntityRelationship_Diagram |
lvt_EntityRelationship_Folder |
lvt_EntityRelationship_Model |
lvt_Subsystem |
lvt_Model |
lvt_EnumLiteral |
lvt_UniqueConstraint |
lvt_PrimaryKeyConstraint |
lvt_ForeignKeyConstraint |
lvt_CheckConstraint |
lvt_Category |
lvt_Port |
lvt_Properties |
lvt_Properties_AutoLayout |
lvt_Properties_Class |
lvt_Properties_CodeGeneration |
lvt_Properties_CodeImport |
lvt_Properties_CodeViewer |
lvt_Properties_Font |
lvt_Properties_General |
lvt_Properties_UserInterface |
lvt_Association |
lvt_Object_Diagram |
lvt_Instance |
lvt_InstanceAttribute |
lvt_Max |
lvt_Unknown |

## Constructor & Destructor Documentation

## ◆ UMLListViewItem() [1/5]

UMLListViewItem::UMLListViewItem | ( | UMLListView * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | UMLObject * | o = 0 )

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  o | The object it represents.

## ◆ UMLListViewItem() [2/5]

UMLListViewItem::UMLListViewItem | ( | UMLListView * | parent | ) |
| explicit

Sets up an instance for subsequent loadFromXMI().

Parameters

  parent | The parent to this instance.

## ◆ UMLListViewItem() [3/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent | ) |
| explicit

Sets up an instance for subsequent loadFromXMI().

Parameters

  parent | The parent to this instance.

## ◆ UMLListViewItem() [4/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | UMLObject * | o = 0 )

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  o | The object it represents.

## ◆ UMLListViewItem() [5/5]

UMLListViewItem::UMLListViewItem | ( | UMLListViewItem * | parent,
|  | const QString & | name,
|  | ListViewType | t,
|  | Uml::ID::Type | id )

Sets up an instance.

Parameters

  parent | The parent to this instance.
  name | The name of this instance.
  t | The type of this instance.
  id | The id of this instance.

## Member Function Documentation

## ◆ addChildItem()

void UMLListViewItem::addChildItem | ( | UMLObject * | child,
|  | UMLListViewItem * | childItem )

Adds to the child object cache the child listview item representing the given UMLObject.

Parameters

  child | Pointer to UMLObject serving as the key into s_comap
  item | Pointer to UMLListViewItem to be returned as the value keyed by child

## ◆ cancelRenameWithMsg()

void UMLListViewItem::cancelRenameWithMsg | ( |  | ) |
| protected

Auxiliary method for okRename().

## ◆ childItem()

UMLListViewItem * UMLListViewItem::childItem | ( | int | i | ) |

## ◆ deepCopy()

UMLListViewItem * UMLListViewItem::deepCopy | ( | UMLListViewItem * | newParent | ) |

Overrides the default sorting to sort by item type. Sort the listview items by type and position within the corresponding list of UMLObjects. If the item does not have a UMLObject then place it last.

Create a deep copy of this UMLListViewItem, but using the given parent instead of the parent of this UMLListViewItem. Return the new UMLListViewItem created.

## ◆ deleteChildItem()

void UMLListViewItem::deleteChildItem | ( | UMLObject * | child | ) |

Deletes the child listview item representing the given UMLObject.

## ◆ deleteItem()

void UMLListViewItem::deleteItem | ( | UMLListViewItem * | childItem | ) |
| static

Deletes the given child listview item representing a UMLObject.

## ◆ findChildObject()

UMLListViewItem * UMLListViewItem::findChildObject | ( | const UMLObject * | child | ) |

Find the UMLListViewItem that represents the given UMLObject in the children of the current UMLListViewItem. Return a pointer to the item or NULL if not found.

## ◆ findItem()

UMLListViewItem * UMLListViewItem::findItem | ( | Uml::ID::Type | id | ) |

Find the UMLListViewItem of the given ID in the tree rooted at the current UMLListViewItem. Return a pointer to the item or NULL if not found.

Parameters

  id | The ID to search for.

Returns
  The item with the given ID or NULL if not found.

## ◆ findUMLObject()

UMLListViewItem * UMLListViewItem::findUMLObject | ( | const UMLObject * | o | ) |

Find the UMLListViewItem that is related to the given UMLObject in the tree rooted at the current UMLListViewItem. Return a pointer to the item or NULL if not found.

## ◆ findUMLObject_r()

UMLListViewItem * UMLListViewItem::findUMLObject_r | ( | const UMLObject * | o | ) |
| protected

Auxiliary function for findUMLObject: Search recursively in child hierarchy.

## ◆ getSavedText()

QString UMLListViewItem::getSavedText | ( |  | ) | const

Returns the saved text.

## ◆ ID()

Uml::ID::Type UMLListViewItem::ID | ( |  | ) | const

Returns the id this class represents.

Returns
  The id this class represents.

## ◆ init()

void UMLListViewItem::init | ( |  | ) |
| protected

Initializes key variables of the class.

## ◆ isOpen()

bool UMLListViewItem::isOpen | ( |  | ) | const
| inline

## ◆ isOwnParent()

bool UMLListViewItem::isOwnParent | ( | Uml::ID::Type | listViewItemID | ) |

Returns true if the UMLListViewItem of the given ID is a parent of this UMLListViewItem.

## ◆ loadFromXMI()

bool UMLListViewItem::loadFromXMI | ( | QDomElement & | qElement | ) |

Loads a "listitem" tag, this is only used by the clipboard currently.

## ◆ saveToXMI()

void UMLListViewItem::saveToXMI | ( | QXmlStreamWriter & | writer | ) |

Saves the listview item to a "listitem" tag.

## ◆ setIcon()

void UMLListViewItem::setIcon | ( | Icon_Utils::IconType | iconType | ) |

Set the pixmap corresponding to the given IconType.

## ◆ setID()

void UMLListViewItem::setID | ( | Uml::ID::Type | id | ) |

Sets the id this class represents. This only sets the ID locally, not at the UMLObject that is perhaps associated to this UMLListViewItem.

Parameters

  id | the id this class represents

## ◆ setOpen()

void UMLListViewItem::setOpen | ( | bool | expand | ) |

Overrides default method. Will call default method but also makes sure correct icon is shown.

## ◆ setText() [1/2]

void UMLListViewItem::setText | ( | const QString & | newText | ) |

Changes the current text of column 0.

## ◆ setText() [2/2]

void UMLListViewItem::setText | ( | int | column,
|  | const QString & | newText )

Changes the current text.

## ◆ setUMLObject()

void UMLListViewItem::setUMLObject | ( | UMLObject * | obj | ) |

Set the UMLObject associated with this instance.

Parameters

  obj | The object this class represents.

## ◆ setVisible()

void UMLListViewItem::setVisible | ( | bool | state | ) |

## ◆ slotEditFinished

void UMLListViewItem::slotEditFinished | ( | const QString & | newText | ) |
| slot

This slot is called to finish item editing

## ◆ toolTip()

QString UMLListViewItem::toolTip | ( |  | ) | const

Returns the signature of items that are operations.

Returns
  signature of an operation item, else an empty string

## ◆ toString()

QString UMLListViewItem::toString | ( | ListViewType | type | ) |
| static

## ◆ type()

UMLListViewItem::ListViewType UMLListViewItem::type | ( |  | ) | const

Returns the type this instance represents.

Returns
  The type this instance represents.

## ◆ umlObject()

UMLObject * UMLListViewItem::umlObject | ( |  | ) | const

Return the UMLObject associated with this instance.

Returns
  The object this class represents.

## ◆ updateFolder()

void UMLListViewItem::updateFolder | ( |  | ) |

Updates the icon on a folder.

## ◆ updateObject()

void UMLListViewItem::updateObject | ( |  | ) |

Updates the representation of the object.

## Member Data Documentation

## ◆ m_id

Uml::ID::Type UMLListViewItem::m_id
| protected

## ◆ m_label

QString UMLListViewItem::m_label
| protected

## ◆ m_object

QPointer<UMLObject> UMLListViewItem::m_object
| protected

## ◆ m_type

ListViewType UMLListViewItem::m_type
| protected

## ◆ s_comap

UMLListViewItem::ChildObjectMap * UMLListViewItem::s_comap
| static protected

The documentation for this class was generated from the following files:

- umbrello/umllistviewitem.h
- umbrello/umllistviewitem.cpp