umbrello/umbrello
#include <umllistview.h>
Public Slots | |
void | childObjectAdded (UMLClassifierListItem *obj) |
void | childObjectRemoved (UMLClassifierListItem *obj) |
void | collapseAll (UMLListViewItem *item) |
void | connectNewObjectsSlots (UMLObject *object) |
void | expandAll (UMLListViewItem *item) |
void | slotCutSuccessful () |
void | slotDeleteSelectedItems () |
void | slotDiagramCreated (Uml::ID::Type id) |
void | slotDiagramRemoved (Uml::ID::Type id) |
void | slotDiagramRenamed (Uml::ID::Type id) |
void | slotDropped (QDropEvent *de, UMLListViewItem *parent, UMLListViewItem *item) |
void | slotMenuSelection (QAction *action) |
void | slotObjectChanged () |
void | slotObjectCreated (UMLObject *object) |
void | slotObjectRemoved (UMLObject *object) |
Static Public Member Functions | |
static bool | mayHaveChildItems (UMLObject::ObjectType type) |
Protected Slots | |
void | slotCollapsed (QTreeWidgetItem *item) |
void | slotExpanded (QTreeWidgetItem *item) |
void | slotItemSelectionChanged () |
Protected Member Functions | |
bool | acceptDrag (QDropEvent *event) const |
void | addAtContainer (UMLListViewItem *item, UMLListViewItem *parent) |
void | childObjectAdded (UMLClassifierListItem *child, UMLClassifier *parent) |
void | commitData (QWidget *editor) |
void | contextMenuEvent (QContextMenuEvent *me) |
void | deleteChildrenOf (UMLListViewItem *parent) |
bool | deleteItem (UMLListViewItem *temp) |
void | dragEnterEvent (QDragEnterEvent *event) |
void | dragMoveEvent (QDragMoveEvent *event) |
void | dropEvent (QDropEvent *event) |
bool | event (QEvent *e) |
UMLListViewItem * | findUMLObjectInFolder (UMLListViewItem *folder, UMLObject *obj) |
void | focusOutEvent (QFocusEvent *fe) |
UMLDragData * | getDragData () |
void | keyPressEvent (QKeyEvent *ke) |
void | mouseDoubleClickEvent (QMouseEvent *me) |
void | mouseMoveEvent (QMouseEvent *me) |
void | mousePressEvent (QMouseEvent *me) |
void | mouseReleaseEvent (QMouseEvent *me) |
Static Protected Member Functions | |
static bool | isExpandable (UMLListViewItem::ListViewType lvt) |
Friends | |
QDebug | operator<< (QDebug out, const UMLListView &view) |
Detailed Description
This is one of the main classes used in this program.
Information is displayed here in a tree view. No objects are created here. A call to UMLDoc make any additions/deletion or updates to objects. This class will then wait for a signal before updating the tree view.
Displays the list view for the program.
Definition at line 48 of file umllistview.h.
Constructor & Destructor Documentation
|
explicit |
Constructs the tree view.
- Parameters
-
parent The parent to this.
Definition at line 84 of file umllistview.cpp.
UMLListView::~UMLListView | ( | ) |
Standard destructor.
Definition at line 127 of file umllistview.cpp.
Member Function Documentation
|
protected |
Event handler for accepting drag request.
- Parameters
-
event the drop event
- Returns
- success state
Definition at line 1369 of file umllistview.cpp.
|
protected |
Auxiliary method for moveObject(): Adds the model object at the proper new container (package if nested, UMLDoc if at global level), and updates the containment relationships in the model.
Definition at line 1514 of file umllistview.cpp.
void UMLListView::addNewItem | ( | UMLListViewItem * | parentItem, |
UMLListViewItem::ListViewType | type | ||
) |
Adds a new item to the tree of the given type under the given parent.
Method will take care of signalling anyone needed on creation of new item. e.g. UMLDoc if an UMLObject is created.
Definition at line 2083 of file umllistview.cpp.
void UMLListView::changeIconOf | ( | UMLObject * | o, |
Icon_Utils::IconType | to | ||
) |
Changes the icon for the given UMLObject to the given icon.
Definition at line 1154 of file umllistview.cpp.
|
protected |
Adds a new operation, attribute or template item to a classifier, identical to childObjectAdded(obj) but with an explicit parent.
- Parameters
-
child the child object parent the parent object
Definition at line 963 of file umllistview.cpp.
|
slot |
Adds a new operation, attribute or template item to a classifier.
- Parameters
-
obj the child object
Definition at line 951 of file umllistview.cpp.
|
slot |
Deletes the list view item.
- Parameters
-
obj the object to remove
Definition at line 996 of file umllistview.cpp.
void UMLListView::clean | ( | ) |
Remove all items and subfolders of the main folders.
Special case: The datatype folder, child of the logical view, is not deleted.
Definition at line 1284 of file umllistview.cpp.
void UMLListView::closeDatatypesFolder | ( | ) |
Definition at line 3000 of file umllistview.cpp.
|
slot |
Close all items in the list view.
Definition at line 2908 of file umllistview.cpp.
|
protected |
Definition at line 3094 of file umllistview.cpp.
|
slot |
Connect some signals into slots in the list view for newly created UMLObjects.
Definition at line 858 of file umllistview.cpp.
|
protected |
Definition at line 1968 of file umllistview.cpp.
bool UMLListView::createChildUMLObject | ( | UMLListViewItem * | item, |
UMLObject::ObjectType | type | ||
) |
Creates a child UMLObject out of the given list view item.
Definition at line 2356 of file umllistview.cpp.
UMLView * UMLListView::createDiagram | ( | UMLListViewItem * | item, |
Uml::DiagramType::Enum | type | ||
) |
Creates a diagram out of the given list view item.
Definition at line 2491 of file umllistview.cpp.
UMLListViewItem * UMLListView::createDiagramItem | ( | UMLView * | view | ) |
Create a listview item for an existing diagram.
- Parameters
-
view The existing diagram.
Definition at line 1870 of file umllistview.cpp.
bool UMLListView::createItem | ( | UMLListViewItem * | item | ) |
Definition at line 2166 of file umllistview.cpp.
UMLObject * UMLListView::createUMLObject | ( | UMLListViewItem * | item, |
UMLObject::ObjectType | type | ||
) |
Creates a UMLObject out of the given list view item.
Definition at line 2269 of file umllistview.cpp.
|
protected |
Deletes all child-items of parent
.
Do it in reverse order, because of the index.
Definition at line 2984 of file umllistview.cpp.
|
protected |
Delete a listview item.
- Parameters
-
temp a non-null UMLListViewItem, for example: (UMLListViewItem*)currentItem()
- Returns
- true if correctly deleted
Definition at line 3010 of file umllistview.cpp.
UMLListViewItem * UMLListView::determineParentItem | ( | UMLObject * | object | ) | const |
Determine the parent ListViewItem given an UMLObject.
- Parameters
-
object Pointer to the UMLObject for which to look up the parent.
- Returns
- Pointer to the parent UMLListViewItem chosen. Returns NULL on error (no parent could be determined.)
Definition at line 730 of file umllistview.cpp.
UMLListViewItem * UMLListView::determineParentItem | ( | UMLListViewItem::ListViewType | lvt | ) | const |
Determine the parent ListViewItem given a ListViewType.
This parent is used for creating new UMLListViewItems.
- Parameters
-
lvt The ListViewType for which to lookup the parent.
- Returns
- Pointer to the parent UMLListViewItem chosen.
Definition at line 1900 of file umllistview.cpp.
UMLDoc * UMLListView::document | ( | ) | const |
Returns the document pointer.
Called by the UMLListViewItem class.
Definition at line 1947 of file umllistview.cpp.
|
protected |
Definition at line 3059 of file umllistview.cpp.
|
protected |
Definition at line 3068 of file umllistview.cpp.
|
protected |
Definition at line 3077 of file umllistview.cpp.
|
protected |
Event handler for the tool tip event.
Works only for operations to show the signature.
Definition at line 167 of file umllistview.cpp.
|
slot |
Open all items in the list view.
Definition at line 2896 of file umllistview.cpp.
UMLListViewItem * UMLListView::findFolderForDiagram | ( | Uml::DiagramType::Enum | dt | ) |
Find the parent folder for a diagram.
If the currently selected item in the list view is a folder then that folder is returned as the parent.
- Parameters
-
dt The Diagram_Type of the diagram. The type will only be used if there is no currently selected item, or if the current item is not a folder. In that case the root folder which is suitable for the Diagram_Type is returned.
- Returns
- Pointer to the parent UMLListViewItem for the diagram.
Definition at line 674 of file umllistview.cpp.
UMLListViewItem * UMLListView::findItem | ( | Uml::ID::Type | id | ) |
Searches through the tree for the item with the given ID.
- Parameters
-
id The ID to search for.
- Returns
- The item with the given ID or 0 if not found.
Definition at line 1232 of file umllistview.cpp.
UMLListViewItem * UMLListView::findUMLObject | ( | const UMLObject * | p | ) | const |
Find an UMLObject in the listview.
- Parameters
-
p Pointer to the object to find in the list view.
- Returns
- Pointer to the UMLObject found or NULL if not found.
Definition at line 1140 of file umllistview.cpp.
|
protected |
This methods looks for a object in a folder an its subfolders recursive.
- Parameters
-
folder The folder entry of the list view. obj The object to be found in the folder.
- Returns
- The object if found else a NULL pointer.
Definition at line 1096 of file umllistview.cpp.
UMLListViewItem * UMLListView::findView | ( | UMLView * | v | ) |
Searches through the tree for the item which represents the diagram given.
- Parameters
-
v the diagram to search for
- Returns
- the item which represents the diagram
Definition at line 1166 of file umllistview.cpp.
|
protected |
Event handler for lost focus.
- Parameters
-
fe the focus event
Definition at line 1956 of file umllistview.cpp.
|
protected |
Definition at line 1071 of file umllistview.cpp.
void UMLListView::init | ( | ) |
Carries out initalisation of attributes in class.
This method is called more than once during an instance's lifetime (by UMLDoc)! So we must not allocate any memory before freeing the previously allocated one or do connect()s.
Definition at line 1247 of file umllistview.cpp.
|
staticprotected |
Return true if the given list view type can be expanded/collapsed.
Definition at line 2015 of file umllistview.cpp.
bool UMLListView::isUnique | ( | UMLListViewItem * | item, |
const QString & | name | ||
) |
Returns if the given name is unique for the given items type.
Definition at line 2532 of file umllistview.cpp.
bool UMLListView::itemRenamed | ( | UMLListViewItem * | item, |
int | col | ||
) |
Called for informing the list view that an item was renamed.
Definition at line 2130 of file umllistview.cpp.
|
protected |
Handler for key press events.
- Parameters
-
ke the key event
Definition at line 276 of file umllistview.cpp.
bool UMLListView::loadChildrenFromXMI | ( | UMLListViewItem * | parent, |
QDomElement & | element | ||
) |
Definition at line 2667 of file umllistview.cpp.
bool UMLListView::loadFromXMI | ( | QDomElement & | element | ) |
Definition at line 2640 of file umllistview.cpp.
|
static |
Return true if the given ObjectType permits child items.
A "child item" is anything that qualifies as a UMLClassifierListItem, e.g. operations and attributes of classifiers.
Definition at line 787 of file umllistview.cpp.
|
protected |
Event handler for mouse double click.
Definition at line 1309 of file umllistview.cpp.
|
protected |
Handler for mouse move events.
- Parameters
-
me the mouse event
Definition at line 230 of file umllistview.cpp.
|
protected |
Handler for mouse press events.
- Parameters
-
me the mouse event
Definition at line 187 of file umllistview.cpp.
|
protected |
Handler for mouse release event.
- Parameters
-
me the mouse event
Definition at line 252 of file umllistview.cpp.
UMLListViewItem * UMLListView::moveObject | ( | Uml::ID::Type | srcId, |
UMLListViewItem::ListViewType | srcType, | ||
UMLListViewItem * | newParent | ||
) |
Moves an object given is unique ID and listview type to an other listview parent item.
Also takes care of the corresponding move in the model.
Definition at line 1543 of file umllistview.cpp.
UMLListViewItem * UMLListView::rootView | ( | UMLListViewItem::ListViewType | type | ) |
Returns the corresponding view if the listview type is one of the root views, Root/Logical/UseCase/Component/Deployment/EntityRelation View.
Definition at line 2949 of file umllistview.cpp.
UMLListViewItem::ListViewType UMLListView::rootViewType | ( | UMLListViewItem * | item | ) |
Determines the root listview type of the given UMLListViewItem.
Starts at the given item, compares it against each of the predefined root views (Root, Logical, UseCase, Component, Deployment, EntityRelationship.) Returns the ListViewType of the matching root view; if no match then continues the search using the item's parent, then grandparent, and so forth. Returns UMLListViewItem::lvt_Unknown if no match at all is found.
Definition at line 1992 of file umllistview.cpp.
void UMLListView::saveToXMI | ( | QDomDocument & | qDoc, |
QDomElement & | qElement | ||
) |
Definition at line 2630 of file umllistview.cpp.
UMLListViewItemList UMLListView::selectedItems | ( | ) |
Get selected items.
- Returns
- the list of selected items
Definition at line 1824 of file umllistview.cpp.
int UMLListView::selectedItemsCount | ( | ) |
Return the amount of items selected.
Definition at line 1938 of file umllistview.cpp.
UMLListViewItemList UMLListView::selectedItemsRoot | ( | ) |
Get selected items, but only root elements selected (without children).
- Returns
- the list of selected root items
Definition at line 1844 of file umllistview.cpp.
void UMLListView::setDocument | ( | UMLDoc * | doc | ) |
Sets the document his is associated with.
This is important as this is required as to setup the callbacks.
- Parameters
-
doc The document to associate with this class.
Definition at line 1028 of file umllistview.cpp.
|
inline |
Definition at line 98 of file umllistview.h.
void UMLListView::setStartedCopy | ( | bool | startedCopy | ) |
Set the variable m_bStartedCopy.
NB: While m_bStartedCut is reset as soon as the Cut operation is done, the variable m_bStartedCopy is reset much later - upon pasting.
Definition at line 2932 of file umllistview.cpp.
void UMLListView::setStartedCut | ( | bool | startedCut | ) |
Set the variable m_bStartedCut to indicate that selection should be deleted in slotCutSuccessful().
Definition at line 2922 of file umllistview.cpp.
void UMLListView::setTitle | ( | int | column, |
const QString & | text | ||
) |
Sets the title.
- Parameters
-
column column in which to write text the text to write
Definition at line 137 of file umllistview.cpp.
void UMLListView::setView | ( | UMLView * | view | ) |
Set the current view to the given view.
- Parameters
-
view The current view.
Definition at line 1297 of file umllistview.cpp.
|
protectedslot |
Calls updateFolder() on the item to update the icon to closed.
Definition at line 2045 of file umllistview.cpp.
|
slot |
Connects to the signal that UMLApp emits when a cut operation is successful.
Definition at line 2057 of file umllistview.cpp.
|
slot |
Delete every selected item.
Definition at line 2070 of file umllistview.cpp.
|
slot |
Creates a new item to represent a new diagram.
- Parameters
-
id the id of the new diagram
Definition at line 705 of file umllistview.cpp.
|
slot |
Removes the item representing a diagram.
- Parameters
-
id the id of the diagram
Definition at line 1061 of file umllistview.cpp.
|
slot |
Renames a diagram in the list view.
- Parameters
-
id the id of the renamed diagram
Definition at line 1011 of file umllistview.cpp.
|
slot |
Something has been dragged and dropped onto the list view.
Definition at line 1798 of file umllistview.cpp.
|
protectedslot |
Calls updateFolder() on the item to update the icon to open.
Definition at line 2034 of file umllistview.cpp.
|
protectedslot |
Handler for item selection changed signals.
Definition at line 145 of file umllistview.cpp.
|
slot |
Called when a right mouse button menu has an item selected.
- Parameters
-
action the selected action
Definition at line 295 of file umllistview.cpp.
|
slot |
Calls updateObject() on the item representing the sending object no parameters, uses sender() to work out which object called the slot.
Definition at line 935 of file umllistview.cpp.
|
slot |
Creates a new list view item and connects the appropriate signals/slots.
- Parameters
-
object the newly created object
Definition at line 807 of file umllistview.cpp.
|
slot |
Disconnects signals and removes the list view item.
- Parameters
-
object the object about to be removed
Definition at line 1046 of file umllistview.cpp.
bool UMLListView::startedCopy | ( | ) | const |
Return the variable m_bStartedCopy.
Definition at line 2940 of file umllistview.cpp.
|
inline |
Definition at line 113 of file umllistview.h.
|
inline |
Definition at line 115 of file umllistview.h.
|
inline |
Definition at line 114 of file umllistview.h.
|
inline |
Definition at line 111 of file umllistview.h.
|
inline |
Definition at line 110 of file umllistview.h.
|
inline |
Definition at line 112 of file umllistview.h.
QString UMLListView::uniqueDiagramName | ( | Uml::DiagramType::Enum | type | ) |
Returns a unique name for a diagram.
Definition at line 2524 of file umllistview.cpp.
Friends And Related Function Documentation
|
friend |
Overloading operator for debugging output.
Definition at line 3136 of file umllistview.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.