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 |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Constructs the tree view.
- Parameters
-
parent | The parent to this. |
UMLListView::~UMLListView |
( |
| ) |
|
bool UMLListView::acceptDrag |
( |
QDropEvent * |
event | ) |
const |
|
protected |
Event handler for accepting drag request.
- Parameters
-
- Returns
- success state
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.
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.
Changes the icon for the given UMLObject to the given icon.
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 |
Adds a new operation, attribute or template item to a classifier.
- Parameters
-
Deletes the list view item.
- Parameters
-
void UMLListView::clean |
( |
| ) |
|
Remove all items and subfolders of the main folders.
void UMLListView::closeDatatypesFolder |
( |
| ) |
|
Close all items in the list view.
void UMLListView::commitData |
( |
QWidget * |
editor | ) |
|
|
protected |
void UMLListView::connectNewObjectsSlots |
( |
UMLObject * |
object | ) |
|
|
slot |
Connect some signals into slots in the list view for newly created UMLObjects.
void UMLListView::contextMenuEvent |
( |
QContextMenuEvent * |
event | ) |
|
|
protected |
Create a listview item for an existing diagram.
- Parameters
-
view | The existing diagram. |
Deletes all child-items of parent
. Do it in reverse order, because of the index.
Delete a listview item.
- Parameters
-
temp | a non-null UMLListViewItem, for example: (UMLListViewItem*)currentItem() |
- Returns
- true if correctly deleted
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.)
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.
UMLDoc * UMLListView::document |
( |
| ) |
const |
void UMLListView::dragEnterEvent |
( |
QDragEnterEvent * |
event | ) |
|
|
protected |
Always allow starting a drag
void UMLListView::dragMoveEvent |
( |
QDragMoveEvent * |
event | ) |
|
|
protected |
Check drag destination and update move/copy action
void UMLListView::dropEvent |
( |
QDropEvent * |
event | ) |
|
|
protected |
bool UMLListView::event |
( |
QEvent * |
e | ) |
|
|
protected |
Event handler for the tool tip event. Works only for operations to show the signature.
Open all items in the list view.
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.
Searches through the tree for the item with the given ID.
- Parameters
-
- Returns
- The item with the given ID or 0 if not found.
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.
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.
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
void UMLListView::focusOutEvent |
( |
QFocusEvent * |
fe | ) |
|
|
protected |
Event handler for lost focus.
- Parameters
-
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.
Return true if the given list view type can be expanded/collapsed.
bool UMLListView::isUnique |
( |
UMLListViewItem * |
item, |
|
|
const QString & |
name |
|
) |
| const |
Returns if the given name is unique for the given items type.
void UMLListView::keyPressEvent |
( |
QKeyEvent * |
ke | ) |
|
|
protected |
Handler for key press events.
- Parameters
-
bool UMLListView::loadChildrenFromXMI |
( |
UMLListViewItem * |
parent, |
|
|
QDomElement & |
element |
|
) |
| |
bool UMLListView::loadFromXMI |
( |
QDomElement & |
element | ) |
|
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.
void UMLListView::mouseDoubleClickEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Event handler for mouse double click.
void UMLListView::mouseMoveEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse move events.
- Parameters
-
void UMLListView::mousePressEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse press events.
- Parameters
-
void UMLListView::mouseReleaseEvent |
( |
QMouseEvent * |
me | ) |
|
|
protected |
Handler for mouse release event.
- Parameters
-
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.
Searches the tree for a diagram (view). Warning: these method may return in some cases the wrong diagram Used by findView().
Returns the corresponding view if the listview type is one of the root views, Root/Logical/UseCase/Component/Deployment/EntityRelation View.
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.
void UMLListView::saveToXMI |
( |
QXmlStreamWriter & |
writer | ) |
|
Get selected items.
- Returns
- the list of selected items
int UMLListView::selectedItemsCount |
( |
| ) |
const |
Return the amount of items selected.
Get selected items, but only root elements selected (without children).
- Returns
- the list of selected root items
void UMLListView::setBackgroundColor |
( |
const QColor & |
color | ) |
|
|
private |
Set the background color.
- Parameters
-
color | the new background color |
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. |
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.
void UMLListView::setStartedCut |
( |
bool |
startedCut | ) |
|
Set the variable m_bStartedCut to indicate that selection should be deleted in slotCutSuccessful().
void UMLListView::setTitle |
( |
int |
column, |
|
|
const QString & |
text |
|
) |
| |
Sets the title.
- Parameters
-
column | column in which to write |
text | the text to write |
void UMLListView::setView |
( |
UMLView * |
view | ) |
|
Set the current view to the given view.
- Parameters
-
void UMLListView::slotCollapsed |
( |
QTreeWidgetItem * |
item | ) |
|
|
protectedslot |
Calls updateFolder() on the item to update the icon to closed.
void UMLListView::slotCutSuccessful |
( |
| ) |
|
|
slot |
Connects to the signal that UMLApp emits when a cut operation is successful.
void UMLListView::slotDeleteSelectedItems |
( |
| ) |
|
|
slot |
Delete every selected item
Creates a new item to represent a new diagram.
- Parameters
-
id | the id of the new diagram |
Removes the item representing a diagram.
- Parameters
-
Renames a diagram in the list view
- Parameters
-
id | the id of the renamed diagram |
void UMLListView::slotDropped |
( |
QDropEvent * |
de, |
|
|
UMLListViewItem * |
target |
|
) |
| |
|
slot |
Something has been dragged and dropped onto the list view.
void UMLListView::slotExpanded |
( |
QTreeWidgetItem * |
item | ) |
|
|
protectedslot |
Calls updateFolder() on the item to update the icon to open.
void UMLListView::slotItemSelectionChanged |
( |
| ) |
|
|
protectedslot |
Handler for item selection changed signals.
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") |
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.
void UMLListView::slotObjectCreated |
( |
UMLObject * |
object | ) |
|
|
slot |
Creates a new list view item and connects the appropriate signals/slots.
- Parameters
-
object | the newly created object |
void UMLListView::slotObjectRemoved |
( |
UMLObject * |
object | ) |
|
|
slot |
Disconnects signals and removes the list view item.
- Parameters
-
object | the object about to be removed |
bool UMLListView::startedCopy |
( |
| ) |
const |
Return the variable m_bStartedCopy.
QDebug operator<< |
( |
QDebug |
out, |
|
|
const UMLListView & |
view |
|
) |
| |
|
friend |
Overloading operator for debugging output.
bool UMLListView::m_bCreatingChildObject |
|
private |
when creating an attribute or an operation to stop it adding a second listViewItem
bool UMLListView::m_bStartedCopy |
|
private |
bool UMLListView::m_bStartedCut |
|
private |
QMimeData* UMLListView::m_dragCopyData |
|
private |
QPoint UMLListView::m_dragStartPosition |
|
private |
QList<QTreeWidgetItem*> UMLListView::m_findItems |
|
private |
predefined list view roots
The documentation for this class was generated from the following files: