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;
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
void CalculateArea(QRect parentArea)
virtual void SetTextFromMap(const InfoMap &infoMap)
Create a group of widgets.
Image widget, displays a single image or multiple images in sequence.
This widget is used for grouping other widgets for display when a particular named state is called.
void SetTextFromMap(const InfoMap &infoMap) override
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
void LoadNow(void) override
Cause images in this and child widgets to be loaded.
MythUIStateType(MythUIType *parent, const QString &name)
void RecalculateArea(bool recurse=true) override
void EnsureStateLoaded(const QString &name)
MythUIType * GetState(const QString &name)
MythUIType * m_currentState
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
bool AddImage(const QString &name, MythImage *image)
QMap< QString, MythUIType * > m_objectsByName
bool DisplayState(const QString &name)
QMap< int, MythUIType * > m_objectsByState
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
virtual void AdjustDependence(void)
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
bool AddObject(const QString &name, MythUIType *object)
All purpose text widget, displays a text string.
void SetTextFromMap(const InfoMap &map)
The base class on which all widgets and screens are based.
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
bool IsVisible(bool recurse=false) const
virtual void SetVisible(bool visible)
virtual void LoadNow(void)
Cause images in this and child widgets to be loaded.
void ExpandArea(QRect rect)
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual MythRect GetFullArea(void) const
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
void DeleteChild(const QString &name)
Delete a named child of this UIType.
void DependChanged(bool isDefault)
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
QList< MythUIType * > m_childrenList
static MythUIType * ParseUIType(const QString &filename, QDomElement &element, const QString &type, MythUIType *parent, MythScreenType *screen, bool showWarnings, QMap< QString, QString > &parentDependsMap)
static bool parseBool(const QString &text)
MythMainWindow * GetMythMainWindow(void)
QHash< QString, QString > InfoMap