Displays the list view for the program.
More...
#include <umllistview.h>
Displays the list view for the program.
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.
- Author
- Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org
◆ UMLListView()
UMLListView::UMLListView |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Constructs the tree view.
- Parameters
-
parent | The parent to this. |
◆ ~UMLListView()
UMLListView::~UMLListView |
( |
| ) |
|
◆ acceptDrag()
bool UMLListView::acceptDrag |
( |
QDropEvent * |
event | ) |
const |
|
protected |
Event handler for accepting drag request.
- Parameters
-
- Returns
- success state
◆ addAtContainer()
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.
◆ addNewItem()
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 a UMLObject is created.
◆ changeIconOf()
Changes the icon for the given UMLObject to the given icon.
◆ childObjectAdded() [1/2]
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 |
◆ childObjectAdded [2/2]
Adds a new operation, attribute or template item to a classifier.
- Parameters
-
◆ childObjectRemoved
Deletes the list view item.
- Parameters
-
◆ clean()
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.
◆ closeDatatypesFolder()
void UMLListView::closeDatatypesFolder |
( |
| ) |
|
◆ collapseAll
Close all items in the list view.
◆ commitData()
void UMLListView::commitData |
( |
QWidget * |
editor | ) |
|
|
protected |
◆ connectNewObjectsSlots
void UMLListView::connectNewObjectsSlots |
( |
UMLObject * |
object | ) |
|
|
slot |
Connect some signals into slots in the list view for newly created UMLObjects.
◆ contextMenuEvent()
void UMLListView::contextMenuEvent |
( |
QContextMenuEvent * |
event | ) |
|
|
protected |
◆ createDiagramItem()
Create a listview item for an existing diagram.
- Parameters
-
view | The existing diagram. |
◆ createItem()
◆ deleteChildrenOf()
Deletes all child-items of parent
. Do it in reverse order, because of the index.
◆ deleteItem()
Delete a listview item.
- Parameters
-
temp | a non-null UMLListViewItem, for example: (UMLListViewItem*)currentItem() |
- Returns
- true if correctly deleted
◆ determineParentItem() [1/2]
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.
◆ determineParentItem() [2/2]
Determine the parent ListViewItem given a 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.)
◆ document()
UMLDoc * UMLListView::document |
( |
| ) |
const |
◆ dragEnterEvent()
void UMLListView::dragEnterEvent |
( |
QDragEnterEvent * |
event | ) |
|
|
protected |
Always allow starting a drag
◆ dragMoveEvent()
void UMLListView::dragMoveEvent |
( |
QDragMoveEvent * |
event | ) |
|
|
protected |
Check drag destination and update move/copy action
◆ dropEvent()
void UMLListView::dropEvent |
( |
QDropEvent * |
event | ) |
|
|
protected |
◆ event()
bool UMLListView::event |
( |
QEvent * |
e | ) |
|
|
protected |
Event handler for the tool tip event. Works only for operations to show the signature.
◆ expandAll
Open all items in the list view.
◆ findFolderForDiagram()
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.
◆ findItem()
Searches through the tree for the item with the given ID.
- Parameters
-
- Returns
- The item with the given ID or 0 if not found.
◆ findUMLObject()
Find a 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.
◆ findUMLObjectInFolder()
This method looks for an object in a folder an its subfolders recursively.
- 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.
◆ findView()
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
◆ focusOutEvent()
void UMLListView::focusOutEvent |
( |
QFocusEvent * |
fe | ) |
|
|
protected |
Event handler for lost focus.
- Parameters
-
◆ getDragData()
◆ init()
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.
◆ isExpandable()
Return true if the given list view type can be expanded/collapsed.
◆ isUnique()
bool UMLListView::isUnique |
( |
UMLListViewItem * |
item, |
|
|
const QString & |
name |
|
) |
| const |
Returns if the given name is unique for the given items type.
◆ keyPressEvent()
void UMLListView::keyPressEvent |
( |
QKeyEvent * |
ke | ) |
|
|
protected |
Handler for key press events.
- Parameters
-
◆ loadChildrenFromXMI()
bool UMLListView::loadChildrenFromXMI |
( |
UMLListViewItem * |
parent, |
|
|
QDomElement & |
element |
|
) |
| |
◆ loadFromXMI()
bool UMLListView::loadFromXMI |
( |
QDomElement & |
element | ) |
|
◆ mayHaveChildItems()
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.
◆ mouseDoubleClickEvent()
void UMLListView::mouseDoubleClickEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Event handler for mouse double click.
◆ mouseMoveEvent()
void UMLListView::mouseMoveEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse move events.
- Parameters
-
◆ mousePressEvent()
void UMLListView::mousePressEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse press events.
- Parameters
-
◆ mouseReleaseEvent()
void UMLListView::mouseReleaseEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse release event.
- Parameters
-
◆ moveObject()
Moves an object given its unique ID and listview type to an other listview parent item. Also takes care of the corresponding move in the model.
◆ recursiveSearchForView()
Searches the tree for a diagram (view). Warning: these method may return in some cases the wrong diagram Used by findView().
◆ rootView()
Returns the corresponding view if the listview type is one of the root views, Root/Logical/UseCase/Component/Deployment/EntityRelation View.
◆ rootViewType()
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.
◆ saveToXMI()
void UMLListView::saveToXMI |
( |
QXmlStreamWriter & |
writer | ) |
|
◆ selectedItems()
Get selected items.
- Returns
- the list of selected items
◆ selectedItemsCount()
int UMLListView::selectedItemsCount |
( |
| ) |
const |
Return the amount of items selected.
◆ selectedItemsRoot()
Get selected items, but only root elements selected (without children).
- Returns
- the list of selected root items
◆ setBackgroundColor()
void UMLListView::setBackgroundColor |
( |
const QColor & |
color | ) |
|
|
private |
Set the background color.
- Parameters
-
color | the new background color |
◆ setDocument()
void UMLListView::setDocument |
( |
UMLDoc * |
doc | ) |
|
Sets the document this is associated with. This is important as this is required as to set up the callbacks.
- Parameters
-
doc | The document to associate with this class. |
◆ setStartedCopy()
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.
◆ setStartedCut()
void UMLListView::setStartedCut |
( |
bool |
startedCut | ) |
|
Set the variable m_bStartedCut to indicate that selection should be deleted in slotCutSuccessful().
◆ setTitle()
void UMLListView::setTitle |
( |
int |
column, |
|
|
const QString & |
text |
|
) |
| |
Sets the title.
- Parameters
-
column | column in which to write |
text | the text to write |
◆ setView()
void UMLListView::setView |
( |
UMLView * |
view | ) |
|
Set the current view to the given view.
- Parameters
-
◆ slotCollapsed
void UMLListView::slotCollapsed |
( |
QTreeWidgetItem * |
item | ) |
|
|
protectedslot |
Calls updateFolder() on the item to update the icon to closed.
◆ slotCutSuccessful
void UMLListView::slotCutSuccessful |
( |
| ) |
|
|
slot |
Connects to the signal that UMLApp emits when a cut operation is successful.
◆ slotDeleteSelectedItems
void UMLListView::slotDeleteSelectedItems |
( |
| ) |
|
|
slot |
Delete every selected item
◆ slotDiagramCreated
Creates a new item to represent a new diagram.
- Parameters
-
id | the id of the new diagram |
◆ slotDiagramRemoved
Removes the item representing a diagram.
- Parameters
-
◆ slotDiagramRenamed
Renames a diagram in the list view
- Parameters
-
id | the id of the renamed diagram |
◆ slotDropped
void UMLListView::slotDropped |
( |
QDropEvent * |
de, |
|
|
UMLListViewItem * |
target |
|
) |
| |
|
slot |
Something has been dragged and dropped onto the list view.
◆ slotExpanded
void UMLListView::slotExpanded |
( |
QTreeWidgetItem * |
item | ) |
|
|
protectedslot |
Calls updateFolder() on the item to update the icon to open.
◆ slotItemSelectionChanged
void UMLListView::slotItemSelectionChanged |
( |
| ) |
|
|
protectedslot |
Handler for item selection changed signals.
◆ slotMenuSelection
void UMLListView::slotMenuSelection |
( |
QAction * |
action, |
|
|
const QPoint & |
position = QPoint() |
|
) |
| |
|
slot |
Called when a right mouse button menu has an item selected.
- Parameters
-
action | the selected action |
position | the position of the menu on the diagram (only used for multi selection "Show") |
◆ slotObjectChanged
void UMLListView::slotObjectChanged |
( |
| ) |
|
|
slot |
Calls updateObject() on the item representing the sending object no parameters, uses sender() to work out which object called the slot.
◆ slotObjectCreated
void UMLListView::slotObjectCreated |
( |
UMLObject * |
object | ) |
|
|
slot |
Creates a new list view item and connects the appropriate signals/slots.
- Parameters
-
object | the newly created object |
◆ slotObjectRemoved
void UMLListView::slotObjectRemoved |
( |
UMLObject * |
object | ) |
|
|
slot |
Disconnects signals and removes the list view item.
- Parameters
-
object | the object about to be removed |
◆ startedCopy()
bool UMLListView::startedCopy |
( |
| ) |
const |
Return the variable m_bStartedCopy.
◆ theComponentView()
◆ theDatatypeFolder()
◆ theDeploymentView()
◆ theLogicalView()
◆ theRootView()
◆ theUseCaseView()
◆ operator<<
QDebug operator<< |
( |
QDebug |
out, |
|
|
const UMLListView & |
view |
|
) |
| |
|
friend |
Overloading operator for debugging output.
◆ m_bCreatingChildObject
bool UMLListView::m_bCreatingChildObject |
|
private |
when creating an attribute or an operation to stop it adding a second listViewItem
◆ m_bStartedCopy
bool UMLListView::m_bStartedCopy |
|
private |
◆ m_bStartedCut
bool UMLListView::m_bStartedCut |
|
private |
◆ m_datatypeFolder
◆ m_doc
◆ m_dragCopyData
QMimeData* UMLListView::m_dragCopyData |
|
private |
◆ m_dragStartPosition
QPoint UMLListView::m_dragStartPosition |
|
private |
◆ m_findItems
QList<QTreeWidgetItem*> UMLListView::m_findItems |
|
private |
◆ m_lv
predefined list view roots
◆ m_rv
◆ m_settingsFolder
The documentation for this class was generated from the following files: