Go to the documentation of this file.
6 #include <QDomDocument>
24 QString key = name.toLower();
32 imType->SetImage(image);
39 QString key = name.toLower();
44 object->SetVisible(
false);
47 MythRect objectArea =
object->GetArea();
60 QString name = QString(
"stateimage%1").arg(
type);
63 imType->SetImage(image);
73 object->SetVisible(
false);
76 MythRect objectArea =
object->GetArea();
91 QMap<QString, MythUIType *>::Iterator i =
m_objectsByName.find(name.toLower());
149 QString lcname = name.toLower();
173 QMap<QString, MythUIType *>::Iterator i;
180 QMap<int, MythUIType *>::Iterator j;
214 const QString &
filename, QDomElement &element,
bool showWarnings)
216 QMap<QString, QString> dependsMap;
217 if (element.tagName() ==
"showempty")
219 else if (element.tagName() ==
"state")
221 QString name = element.attribute(
"name",
"");
222 QString
type = element.attribute(
"type",
"");
231 element.setAttribute(
"name", statename);
242 else if (
type ==
"half")
244 else if (
type ==
"full")
250 else if (!name.isEmpty())
275 QMap<QString, MythUIType *>::iterator i;
277 for (i = st->m_objectsByName.begin(); i != st->m_objectsByName.end(); ++i)
280 const QString& key = i.key();
287 QMap<int, MythUIType *>::iterator j;
289 for (j = st->m_objectsByState.begin(); j != st->m_objectsByState.end(); ++j)
320 i.value()->LoadNow();
328 i.value()->LoadNow();
341 if (objectName().startsWith(
"buttonlist button"))
362 child->RecalculateArea(recurse);
374 for (
auto *child : std::as_const(*children))
376 if (child->IsVisible())
390 QMap<QString, MythUIType *>::Iterator i;
405 QMap<int, MythUIType *>::Iterator j;
QMap< QString, MythUIType * > m_objectsByName
void EnsureStateLoaded(const QString &name)
Image widget, displays a single image or multiple images in sequence.
void DeleteChild(const QString &name)
Delete a named child of this UIType.
virtual MythRect GetFullArea(void) const
MythUIType * GetState(const QString &name)
void SetTextFromMap(const InfoMap &infoMap) override
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
void RecalculateArea(bool recurse=true) override
Create a group of widgets.
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
void ExpandArea(QRect rect)
QHash< QString, QString > InfoMap
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
void DependChanged(bool isDefault)
void LoadNow(void) override
Cause images in this and child widgets to be loaded.
virtual void SetTextFromMap(const InfoMap &infoMap)
void CalculateArea(QRect parentArea)
QList< MythUIType * > m_childrenList
virtual void AdjustDependence(void)
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
bool AddImage(const QString &name, MythImage *image)
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
The base class on which all widgets and screens are based.
QMap< int, MythUIType * > m_objectsByState
All purpose text widget, displays a text string.
static MythUIType * ParseUIType(const QString &filename, QDomElement &element, const QString &type, MythUIType *parent, MythScreenType *screen, bool showWarnings, QMap< QString, QString > &parentDependsMap)
virtual void LoadNow(void)
Cause images in this and child widgets to be loaded.
MythUIType * m_currentState
void SetTextFromMap(const InfoMap &map)
virtual void SetVisible(bool visible)
MythUIStateType(MythUIType *parent, const QString &name)
MythMainWindow * GetMythMainWindow(void)
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
static bool parseBool(const QString &text)
bool IsVisible(bool recurse=false) const
This widget is used for grouping other widgets for display when a particular named state is called....
bool AddObject(const QString &name, MythUIType *object)
bool DisplayState(const QString &name)