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  MythUIText *textType = dynamic_cast<MythUIText *> (type);
19  if (textType)
20  textType->SetTextFromMap(infoMap);
21 
22  MythUIComposite *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  MythUIText *textType = dynamic_cast<MythUIText *> (type);
41  if (textType)
42  textType->ResetMap(infoMap);
43 
44  MythUIComposite *group = dynamic_cast<MythUIComposite *> (type);
45  if (group)
46  group->ResetMap(infoMap);
47  }
48 }
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:196
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void SetTextFromMap(const InfoMap &map)
Definition: mythuitext.cpp:158
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
virtual void SetTextFromMap(const InfoMap &infoMap)
void ResetMap(const InfoMap &map)
Definition: mythuitext.cpp:97
const char * name
Definition: ParseText.cpp:328
virtual void ResetMap(const InfoMap &infoMap)
MythUIComposite(QObject *parent, const QString &name)