MythTV  master
mythuicomposite.cpp
Go to the documentation of this file.
1 #include "mythuicomposite.h"
2 #include "mythuitext.h"
3 
4 MythUIComposite::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 
28 void MythUIComposite::ResetMap(const InfoMap &infoMap)
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 }
mythuitext.h
MythUIComposite::ResetMap
virtual void ResetMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:28
MythUIText::ResetMap
void ResetMap(const InfoMap &map)
Definition: mythuitext.cpp:96
mythuicomposite.h
MythUIType::GetAllChildren
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:197
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythUIComposite::SetTextFromMap
virtual void SetTextFromMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:9
MythUIComposite::MythUIComposite
MythUIComposite(QObject *parent, const QString &name)
Definition: mythuicomposite.cpp:4
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythUIText::SetTextFromMap
void SetTextFromMap(const InfoMap &map)
Definition: mythuitext.cpp:155
MythUIComposite
Definition: mythuicomposite.h:7