This class represents a tree. More...
#include "aTreeWidget.h"
Signals | |
void | keyPressed (QKeyEvent *) |
void | keyReleased (QKeyEvent *) |
void | mouseMove (QMouseEvent *) |
void | leave (QEvent *) |
Public Member Functions | |
aTreeWidgetBase (aTreeWidget *_ownerTree) | |
Constructor. | |
virtual | ~aTreeWidgetBase () |
virtual void | keyPressEvent (QKeyEvent *_event) override |
Emits a key pressend signal a key is pressed. | |
virtual void | keyReleaseEvent (QKeyEvent *_event) override |
Emits a key released signal a key is released. | |
virtual void | mouseMoveEvent (QMouseEvent *event) override |
Emits a mouse move event. | |
virtual void | leaveEvent (QEvent *event) override |
Emits a FocusLeft event. | |
virtual void | dropEvent (QDropEvent *_event) override |
virtual void | dragEnterEvent (QDragEnterEvent *_event) override |
virtual void | dragLeaveEvent (QDragLeaveEvent *_event) override |
virtual QWidget * | widget (void) override |
Will return the widgets widget to display it. | |
void | AddTopLevelItem (aTreeWidgetItem *_item) |
Will add the provided item to the top level and store its information. | |
void | itemWasMovedToTopLevel (aTreeWidgetItem *_item) |
aTreeWidgetItem * | topLevelItem (const QString &_text) |
Will return the top level item with the provided text Returns nullptr if the item does not exist. | |
aTreeWidgetItem * | topLevelItem (ID _id) |
Will return the top level item with the provided ID Returns nullptr if the item does not exist. | |
std::vector< QString > | topLevelItemsText (void) |
Will return the names of all top level items. | |
void | Clear (void) |
Will clear the tree. | |
void | removeTopLevelItem (ID _id) |
Will remove the topLevelItem with the provided ID Will not destroy the item. | |
QList< aTreeWidgetItem * > | selectedItemsRef (void) const |
void | extendedItemSelectionInformation (const QList< aTreeWidgetItem * > &_selectedItems, QList< ID > &_selectedItemIds, QList< ID > &_itemParentIds) const |
Public Member Functions inherited from ak::aWidget | |
aWidget (objectType _type=otNone, UID _UID=invalidUID) | |
Constructor. | |
virtual | ~aWidget () |
Deconstructor. | |
virtual bool | isWidgetType (void) const override |
Returns true the object is derived from aWidget. | |
Public Member Functions inherited from ak::aObject | |
aObject (objectType _type=otNone, UID _UID=ak::invalidUID) | |
Constructor. | |
aObject (const aObject &_other) | |
Copy constructor. | |
aObject & | operator= (const aObject &_other) |
Assignment operator. | |
virtual | ~aObject () |
Deconstructor. | |
virtual void | removeChildObject (aObject *_child) |
Will remove the child from this object (not destroy it) This function should be called from the deconstructor of a child. | |
virtual void | addChildObject (aObject *_child) |
Will add the child to this object. | |
void | setUniqueName (const QString &_name) |
Will set this objects unique name. | |
virtual void | setParentObject (aObject *_parentObject) |
Will set the parent object of this object. | |
QString | uniqueName (void) const |
Will return the unique name of this object. | |
aObject * | parentObject (void) const |
Will return a pointer to the parent object. | |
int | childObjectCount (void) const |
Will return the count of sub objects. | |
aObject * | childObject (UID _childUID) |
Will return the child with the specified UID. | |
void | setOwner (aObject *_object) |
Will set the owner of this object. | |
aObject * | owner (void) const |
Will return the owner of this object. | |
void | setUid (UID _UID) |
Will set the objects UID. | |
UID | uid (void) const |
Returns the objects UID. | |
objectType | type (void) const |
Returns the objects type. | |
Static Public Member Functions | |
static ID | getItemId (QTreeWidgetItem *_item) |
Will extract the id form the QTreeWidgetItem (which must be a treeItem) | |
Additional Inherited Members | |
Protected Attributes inherited from ak::aObject | |
UID | m_uid |
int | m_references |
The objects UID. | |
objectType | m_objectType |
The objects references. | |
QString | m_uniqueName |
The object type of this object. | |
aObject * | m_parentObject |
aObject * | m_owner |
std::map< UID, aObject * > | m_childObjects |
This class represents a tree.
ak::aTreeWidgetBase::aTreeWidgetBase | ( | aTreeWidget * | _ownerTree | ) |
Constructor.
|
virtual |
void ak::aTreeWidgetBase::AddTopLevelItem | ( | aTreeWidgetItem * | _item | ) |
Will add the provided item to the top level and store its information.
_item | The item to add |
void ak::aTreeWidgetBase::Clear | ( | void | ) |
Will clear the tree.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
void ak::aTreeWidgetBase::extendedItemSelectionInformation | ( | const QList< aTreeWidgetItem * > & | _selectedItems, |
QList< ID > & | _selectedItemIds, | ||
QList< ID > & | _itemParentIds ) const |
|
static |
Will extract the id form the QTreeWidgetItem (which must be a treeItem)
void ak::aTreeWidgetBase::itemWasMovedToTopLevel | ( | aTreeWidgetItem * | _item | ) |
|
signal |
|
overridevirtual |
Emits a key pressend signal a key is pressed.
|
signal |
|
overridevirtual |
Emits a key released signal a key is released.
|
signal |
|
overridevirtual |
Emits a FocusLeft event.
|
signal |
|
overridevirtual |
Emits a mouse move event.
void ak::aTreeWidgetBase::removeTopLevelItem | ( | ak::ID | _id | ) |
Will remove the topLevelItem with the provided ID Will not destroy the item.
QList< ak::aTreeWidgetItem * > ak::aTreeWidgetBase::selectedItemsRef | ( | void | ) | const |
ak::aTreeWidgetItem * ak::aTreeWidgetBase::topLevelItem | ( | const QString & | _text | ) |
Will return the top level item with the provided text Returns nullptr if the item does not exist.
ak::aTreeWidgetItem * ak::aTreeWidgetBase::topLevelItem | ( | ak::ID | _id | ) |
Will return the top level item with the provided ID Returns nullptr if the item does not exist.
std::vector< QString > ak::aTreeWidgetBase::topLevelItemsText | ( | void | ) |
Will return the names of all top level items.
|
overridevirtual |
Will return the widgets widget to display it.
Implements ak::aWidget.