Go to the documentation of this file.
35 if (onesel && !twosel)
88 bool selectable_flag,
bool visible)
91 an_int, selectable_flag);
92 new_node->SetVisible(visible);
97 const QString &sortText,
int an_int,
bool
98 selectable_flag,
bool visible)
101 an_int, selectable_flag);
102 new_node->SetVisible(visible);
103 new_node->SetSortText(sortText);
168 for (
int i = 0; i < route_of_branches.count(); i++)
173 bool foundit =
false;
174 QList<MythGenericTree*>::iterator it;
182 for (it = children->begin(); it != children->end(); ++it)
187 if (child->
getInt() == route_of_branches[i])
216 QList<int> routeByID;
218 routeByID.push_front(
getInt());
223 routeByID.push_front(parent->
getInt());
230 QStringList routeByString;
232 routeByString.push_front(
GetText());
237 routeByString.push_front(parent->
GetText());
239 return routeByString;
244 QList<MythGenericTree*> route;
246 route.push_front(
this);
251 route.push_front(parent);
273 QList<MythGenericTree *> route =
getRoute();
275 return (route.size() - 1);
299 for (
auto *child : qAsConst(*list))
301 if (child->IsVisible())
318 else if (onlyVisible)
323 return selectedChild;
331 LOG(VB_GENERAL, LOG_ERR,
"Top level can't become selected child");
344 if (position < number_up)
382 if (children && children->count() > 0)
384 SortableMythGenericTreeList::Iterator it;
387 for (it = children->begin(); it != children->end(); ++it)
392 if (child->
GetText() == a_name)
403 if (children && children->count() > 0)
405 SortableMythGenericTreeList::Iterator it;
408 for (it = children->begin(); it != children->end(); ++it)
413 if (child->
getInt() == an_int)
426 if (children && children->count() > 0)
428 SortableMythGenericTreeList::Iterator it;
431 for (it = children->begin(); it != children->end(); ++it)
445 QList<MythGenericTree*>::iterator it;
448 while ((child = *it) !=
nullptr)
505 item->SetData(QVariant::fromValue(
this));
514 item->setDrawArrow(
true);
520 const QString &state)
525 textprop.
text = text;
526 textprop.
state = state;
538 const QString &state)
540 InfoMap::const_iterator map_it = infoMap.begin();
541 while (map_it != infoMap.end())
544 textprop.
text = (*map_it);
545 textprop.
state = state;
565 if (!result.isEmpty())
600 if (!result.isEmpty())
637 if (!result.isEmpty())
641 InfoMap::const_iterator it =
m_states.find(name);
void Sort(SortType stype, int attributeIndex=0)
QString GetSortText() const
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
QString GetText(const QString &name="") const
void setParent(MythGenericTree *a_parent)
static int sortBySelectable(MythGenericTree *one, MythGenericTree *two)
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
virtual ~MythGenericTree()
void setSelectedChild(MythGenericTree *a_node)
uint visibleChildCount() const
int currentDepth(void)
Establish how deep in the current tree this node lies.
void SetImageCb(mgtCbFn fn, void *data)
void SetImageFromMap(const InfoMap &infoMap)
void SetTextCb(mgtCbFn fn, void *data)
MythGenericTree * getChildByName(const QString &a_name) const
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void DisplayStateFromMap(const InfoMap &infoMap)
static bool sortByString(MythGenericTree *one, MythGenericTree *two)
bool isSelectable() const
QString GetImage(const QString &name="") const
void SetStateCb(mgtCbFn fn, void *data)
QString(*)(const QString &name, void *data) mgtCbFn
QHash< QString, QString > InfoMap
MythGenericTree * getChildAt(uint reference) const
MythGenericTree * addNode(const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
MythGenericTree * getSelectedChild(bool onlyVisible=false) const
QStringList getRouteByString(void)
void SetImage(const QString &filename, const QString &name="")
int childCount(void) const
MythGenericTree * prevSibling(int number_up)
MythGenericTree * nextSibling(int number_down)
MythGenericTree * m_parent
virtual MythUIButtonListItem * CreateListButton(MythUIButtonList *list)
MythGenericTree * getVisibleChildAt(uint reference) const
void SetAttributeIndex(int index)
void SetVisible(bool visible)
QList< MythGenericTree * > * getAllChildren() const
MythGenericTree * findNode(QList< int > route_of_branches)
int siblingCount(void) const
void DetachParent(void)
Detach this node/branch from it's parent without deleting it, it can then be reattached elsewhere or ...
QString GetState(const QString &name="") const
SortableMythGenericTreeList()=default
void deleteNode(MythGenericTree *child)
void removeNode(MythGenericTree *child)
MythGenericTree * getParent(void) const
MythGenericTree * findLeaf()
void DisplayState(const QString &state, const QString &name="")
MythGenericTree(const QString &a_string="", int an_int=0, bool selectable_flag=false)
QList< MythGenericTree * > getRoute(void)
MythGenericTree * getChildById(int an_int) const
MythGenericTree * m_selectedSubnode
QList< int > getRouteById(void)
void SetText(const QString &text, const QString &name="", const QString &state="")
int getChildPosition(MythGenericTree *child) const
void SetSortType(SortType stype)
void MoveItemUpDown(MythGenericTree *item, bool flag)
void ensureSortFields(void)
void becomeSelectedChild(void)
SortableMythGenericTreeList * m_subnodes
QMap< QString, TextProperties > m_strings