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 for (auto *type : std::as_const(*children))
13 {
14 auto *textType = dynamic_cast<MythUIText *> (type);
15 if (textType)
16 textType->SetTextFromMap(infoMap);
17
18 auto *group = dynamic_cast<MythUIComposite *> (type);
19 if (group)
20 group->SetTextFromMap(infoMap);
21 }
22}
23
25{
26 if (infoMap.isEmpty())
27 return;
28
29 QList<MythUIType *> *children = GetAllChildren();
30 for (auto *type : std::as_const(*children))
31 {
32 auto *textType = dynamic_cast<MythUIText *> (type);
33 if (textType)
34 textType->ResetMap(infoMap);
35
36 auto *group = dynamic_cast<MythUIComposite *> (type);
37 if (group)
38 group->ResetMap(infoMap);
39 }
40}
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:187
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15