|
A class to efficiently build and maintain sorted items of QTreeWidget
or QTreeWidgetItem
based on a map matching the intended structure.
More...
#include <RobotAPI/libraries/armem_gui/TreeWidgetBuilder.h>
Public Types | |
using | Base = TreeWidgetBuilder< typename MapT::value_type > |
using | CompareFn = std::function< int(const ElementT &element, QTreeWidgetItem *item)> |
using | ElementT = typename Base::ElementT |
using | MakeItemFn = std::function< QTreeWidgetItem *(const KeyT &key, const ValueT &value)> |
using | MapT = std::map< KeyT, ValueT > |
using | NameFn = std::function< std::string(const KeyT &key, const ValueT &value)> |
using | UpdateItemFn = std::function< bool(const KeyT &key, const ValueT &value, QTreeWidgetItem *item)> |
Public Member Functions | |
MapTreeWidgetBuilder () | |
MapTreeWidgetBuilder (const MapT &) | |
Allows declaring instance from container without explicit template arguments. More... | |
MapTreeWidgetBuilder (MakeItemFn makeItemFn, UpdateItemFn updateItemFn=NoUpdate) | |
MapTreeWidgetBuilder (NameFn nameFn, MakeItemFn makeItemFn, UpdateItemFn updateItemFn=NoUpdate) | |
void | setCompareFn (CompareFn compareFn) |
void | setExpand (bool expand) |
void | setMakeItemFn (MakeItemFn makeItemFn) |
void | setNameFn (NameFn nameFn) |
void | setUpdateItemFn (UpdateItemFn updateItemFn) |
template<class ParentT > | |
void | updateTree (ParentT *tree, const MapT &elements) |
Static Public Member Functions | |
static std::string | KeyAsName (const KeyT &key, const ValueT &value) |
A name function using the key as name. More... | |
static bool | NoUpdate (const KeyT &key, const ValueT &value, QTreeWidgetItem *item) |
No update function (default). More... | |
A class to efficiently build and maintain sorted items of QTreeWidget
or QTreeWidgetItem
based on a map matching the intended structure.
Definition at line 124 of file TreeWidgetBuilder.h.
using Base = TreeWidgetBuilder<typename MapT::value_type> |
Definition at line 127 of file TreeWidgetBuilder.h.
Definition at line 130 of file TreeWidgetBuilder.h.
using ElementT = typename Base::ElementT |
Definition at line 128 of file TreeWidgetBuilder.h.
using MakeItemFn = std::function<QTreeWidgetItem*(const KeyT& key, const ValueT& value)> |
Definition at line 133 of file TreeWidgetBuilder.h.
using MapT = std::map<KeyT, ValueT> |
Definition at line 126 of file TreeWidgetBuilder.h.
using NameFn = std::function<std::string(const KeyT& key, const ValueT& value)> |
Definition at line 131 of file TreeWidgetBuilder.h.
using UpdateItemFn = std::function<bool(const KeyT& key, const ValueT& value, QTreeWidgetItem* item)> |
Definition at line 134 of file TreeWidgetBuilder.h.
|
inline |
Definition at line 137 of file TreeWidgetBuilder.h.
|
inline |
Allows declaring instance from container without explicit template arguments.
Definition at line 142 of file TreeWidgetBuilder.h.
|
inline |
Definition at line 145 of file TreeWidgetBuilder.h.
|
inline |
Definition at line 150 of file TreeWidgetBuilder.h.
|
inlinestatic |
A name function using the key as name.
Definition at line 202 of file TreeWidgetBuilder.h.
|
inlinestatic |
No update function (default).
Definition at line 218 of file TreeWidgetBuilder.h.
|
inline |
Definition at line 166 of file TreeWidgetBuilder.h.
|
inline |
Definition at line 188 of file TreeWidgetBuilder.h.
|
inline |
|
inline |
|
inline |
|
inline |