4#include <QCoreApplication>
19 m_timeFormat(
GetMythDB()->GetSetting(
"TimeFormat",
"h:mm ap")),
20 m_dateFormat(
GetMythDB()->GetSetting(
"DateFormat",
"ddd d MMM yyyy")),
21 m_shortDateFormat(
GetMythDB()->GetSetting(
"ShortDateFormat",
"ddd M/d"))
54 QDateTime dt =
m_time.toLocalTime();
58#if QT_VERSION < QT_VERSION_CHECK(6,5,0)
65 QTimeZone(QTimeZone::UTC));
91 const QString &
filename, QDomElement &element,
bool showWarnings)
93 if (element.tagName() ==
"format" ||
94 element.tagName() ==
"template")
97 format = QCoreApplication::translate(
"ThemeUI", format.toUtf8());
98 format.replace(
"%TIME%",
m_timeFormat, Qt::CaseInsensitive);
99 format.replace(
"%DATE%",
m_dateFormat, Qt::CaseInsensitive);
122 LOG(VB_GENERAL, LOG_ERR,
"ERROR, bad parsing");
144 auto *clock =
new MythUIClock(parent, objectName());
145 clock->CopyFrom(
this);
A simple text clock widget.
void SetText(const QString &text) override
This sets the text, unless the string is blank, in that case the time is looked up and set as the tex...
QString GetTimeText(void)
This creates a string based on m_time, and sets m_nextUpdate to the second following m_time.
void Pulse(void) override
Looks up the time and sets the clock if the current time is greater than or equal to m_nextUpdate.
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
QString m_shortDateFormat
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
MythUIClock(MythUIType *parent, const QString &name)
All purpose text widget, displays a text string.
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
MythFontProperties * m_font
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
virtual void SetText(const QString &text)
The base class on which all widgets and screens are based.
static QString parseText(QDomElement &element)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.