26#include <qtreewidget.h>
46 class aTreeWidgetBase;
47 class aTreeWidgetItem;
48 class aLineEditWidget;
63 virtual QWidget * widget(
void)
override;
73 const QString & _text =
"",
93 char _delimiter =
'|',
95 const QIcon & _icon = QIcon()
99 void clear(
bool _emitEvent =
true);
113 bool _readOnly =
true
120 void setItemSelected(
122 bool _selected =
true
138 const QString & _text
145 void setSingleItemSelected(
154 void toggleItemSelection(
160 void deselectAllItems(
184 void setSortingEnabled(
194 void setFilterVisible(
200 void applyCurrentFilter(
void);
205 void setFilterCaseSensitive(
212 void setFilterRefreshOnChange(
213 bool _refreshOnChange
218 void setMultiSelectionEnabled(
224 void setAutoSelectAndDeselectChildrenEnabled(
229 void expandAllItems(
void);
241 void collapseAllItems(
void);
247 bool _supressSelectionChangedEvent =
false
253 const std::vector<ID> & _itemIDs,
254 bool _supressSelectionChangedEvent =
false
260 void setItemsAreEditable(
261 bool _editable =
true,
262 bool _applyToAll =
true
268 void setItemIsEditable(
276 void setItemIsEditable(
277 const std::vector<ID> & _itemIDs,
284 void setItemSelectChildren(
297 std::vector<ID> selectedItems(
void);
301 std::vector<QString> getItemPath(
308 QString getItemPathString(
310 char _delimiter =
'|'
317 const QString & _itemPath,
318 char _delimiter =
'|'
331 aTreeWidgetItem* itemFromPath(
const QString& _itemPath,
char _delimiter =
'|');
334 bool enabled()
const;
337 int itemCount(
void)
const;
340 bool isSortingEnabled(
void)
const;
345 bool getMultiSelectionEnabled(
void);
368 void selectionChangedEvent(
369 bool _emitEvent =
true
389 void itemsMoved(
const QList<ID>& _itemIds,
const QList<ID>& _oldParentIds,
const QList<ID>& _newParentIds);
394 void slotTreeKeyPressed(QKeyEvent * _event);
395 void slotTreeKeyReleased(QKeyEvent * _event);
396 void slotTreeItemActivated(QTreeWidgetItem * _item,
int _column);
397 void slotTreeItemChanged(QTreeWidgetItem * _item,
int _column);
398 void slotTreeItemClicked(QTreeWidgetItem * _item,
int _column);
399 void slotTreeItemCollapsed(QTreeWidgetItem * _item);
400 void slotTreeItemDoubleClicked(QTreeWidgetItem * _item,
int _column);
401 void slotTreeItemExpanded(QTreeWidgetItem * _item);
402 void slotTreeSelectionChanged();
403 void slotTreeMouseMove(QMouseEvent *);
404 void slotTreeLeave(QEvent *);
405 void slotCustomContextMenuRequested(
const QPoint& _pos);
408 void slotFilterTextChanged(
void);
411 void slotFilterKeyPressed(QKeyEvent * _event);
424 const QString & _text =
"",
426 QIcon _icon = QIcon()
429 void refreshAfterItemsMoved(
const QList<aTreeWidgetItem *>& _items,
const QList<ID>& _itemIds,
430 const QList<ID>& _oldParentIds,
const QList<ID>& _newParentIds);
444 QVBoxLayout * m_layout;
445 bool m_filterCaseSensitive;
446 bool m_filterRefreshOnChange;
449 bool m_displayChildsOnFilter;
453 QString m_headerText;
457 std::map<ID, aTreeWidgetItem *> m_items;
459 bool m_selectAndDeselectChildren;
460 bool m_itemsAreEditable;
482 virtual void keyPressEvent(QKeyEvent * _event)
override;
485 virtual void keyReleaseEvent(QKeyEvent * _event)
override;
488 virtual void mouseMoveEvent(QMouseEvent *event)
override;
491 virtual void leaveEvent(QEvent *event)
override;
493 virtual void dropEvent(QDropEvent * _event)
override;
495 virtual void dragEnterEvent(QDragEnterEvent * _event)
override;
497 virtual void dragLeaveEvent(QDragLeaveEvent * _event)
override;
502 virtual QWidget * widget(
void)
override;
508 void AddTopLevelItem(
517 const QString & _text
527 std::vector<QString> topLevelItemsText(
void);
534 void removeTopLevelItem(
542 QTreeWidgetItem * _item
545 QList<aTreeWidgetItem *> selectedItemsRef(
void)
const;
546 void extendedItemSelectionInformation(
const QList<aTreeWidgetItem *>& _selectedItems, QList<ID>& _selectedItemIds, QList<ID>& _itemParentIds)
const;
556 std::map<ID, aTreeWidgetItem *> m_topLevelItems;
612 void setChildsEnabled(
618 void setChildsSelected(
624 void setChildsVisible(
629 void ensureTopLevelSelectionVisible();
633 void expandAllParents(
640 void setEditable(
bool _editable =
true);
642 void setLocked(
bool _locked =
true);
648 bool _expandParents =
true
664 const QString & _text
671 const QStringList & _itemPath,
683 bool hasChilds(
void);
689 const std::list<aTreeWidgetItem *> & childs(
void);
692 const std::list<aTreeWidgetItem *> & allChilds(
void);
695 const std::list<ID> & allChildsIDs(
void);
698 int childCount(
void)
const;
705 ID parentId(
void)
const;
714 std::list<QString> getItemPath();
719 QString getItemPathString(
720 char _delimiter =
'|'
732 void refreshEditableState(
void);
735 std::list<aTreeWidgetItem *> m_childs;
736 std::list<aTreeWidgetItem *> m_allChilds;
737 std::list<ID> m_allChildsIDs;
741 bool m_isLockedForEdit;
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
This class is used to store the main information of any object used Information contained is the UID ...
Definition aObject.h:34
textAlignment
Describes the text alignment.
Definition akCore.h:210
@ alignLeft
Definition akCore.h:211
int ID
The ID datatype used for items.
Definition globalDataTypes.h:68