MythTV master
mythuicomposite.cpp
Go to the documentation of this file.
1#include "mythuicomposite.h"
2#include "mythuitext.h"
3
4MythUIComposite::MythUIComposite(QObject *parent, const QString &name) :
5 MythUIType(parent, name)
6{
7}
8
10{
11 QList<MythUIType *> *children = GetAllChildren();
12 QMutableListIterator<MythUIType *> i(*children);
13
14 while (i.hasNext())
15 {
16 MythUIType *type = i.next();
17
18 auto *textType = dynamic_cast<MythUIText *> (type);
19 if (textType)
20 textType->SetTextFromMap(infoMap);
21
22 auto *group = dynamic_cast<MythUIComposite *> (type);
23 if (group)
24 group->SetTextFromMap(infoMap);
25 }
26}
27
29{
30 if (infoMap.isEmpty())
31 return;
32
33 QList<MythUIType *> *children = GetAllChildren();
34 QMutableListIterator<MythUIType *> i(*children);
35
36 while (i.hasNext())
37 {
38 MythUIType *type = i.next();
39
40 auto *textType = dynamic_cast<MythUIText *> (type);
41 if (textType)
42 textType->ResetMap(infoMap);
43
44 auto *group = dynamic_cast<MythUIComposite *> (type);
45 if (group)
46 group->ResetMap(infoMap);
47 }
48}
MythUIComposite(QObject *parent, const QString &name)
virtual void SetTextFromMap(const InfoMap &infoMap)
virtual void ResetMap(const InfoMap &infoMap)
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
void SetTextFromMap(const InfoMap &map)
Definition: mythuitext.cpp:138
void ResetMap(const InfoMap &map)
Definition: mythuitext.cpp:79
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:202
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15