|
KD Reports API Documentation
2.0
|
Go to the documentation of this file.
22 if (str == QLatin1String(
"left"))
24 else if (str == QLatin1String(
"right"))
25 return Qt::AlignRight;
26 else if (str == QLatin1String(
"hcenter"))
27 return Qt::AlignHCenter;
29 qWarning(
"Unexpected alignment flag in KDReports::Report::stringToAlignment(): %s", qPrintable(str));
35 if (type == QLatin1String(
"pagenumber"))
37 else if (type == QLatin1String(
"pagecount"))
39 else if (type == QLatin1String(
"textdate"))
41 else if (type == QLatin1String(
"isodate"))
43 else if (type == QLatin1String(
"localedate"))
45 else if (type == QLatin1String(
"texttime"))
47 else if (type == QLatin1String(
"isotime"))
49 else if (type == QLatin1String(
"localetime"))
51 qWarning(
"Unexpected variable type: %s", qPrintable(type));
58 const QString name = element.attribute(QLatin1String(attributeName));
59 if (!name.isEmpty()) {
68 if (element.hasAttribute(QStringLiteral(
"background"))) {
69 const QString name = element.attribute(QStringLiteral(
"background"));
71 }
else if (element.hasAttribute(QStringLiteral(
"bgred")) && element.hasAttribute(QStringLiteral(
"bggreen")) && element.hasAttribute(QStringLiteral(
"bgblue"))) {
76 red = element.attribute(QStringLiteral(
"bgred")).toInt(&ok);
78 green = element.attribute(QStringLiteral(
"bggreen")).toInt(&ok);
80 blue = element.attribute(QStringLiteral(
"bgblue")).toInt(&ok);
94 if (xmlAttr.isEmpty())
96 KDReports::HeaderLocations loc;
97 const QStringList tokens = xmlAttr.toLower().split(QLatin1Char(
','));
98 for (
const QString &s : tokens) {
99 QString token = s.trimmed();
100 if (token == QLatin1String(
"first"))
102 else if (token == QLatin1String(
"last"))
104 else if (token == QLatin1String(
"odd"))
106 else if (token == QLatin1String(
"even"))
108 else if (token == QLatin1String(
"all"))
111 qWarning() <<
"Found unexpected token in header location attribute:" << token;
@ FirstPage
The first page of the report.
@ LocaleTime
Current time in locale-dependent format.
static QColor readBackground(const QDomElement &element)
@ TextTime
Current time in text format like "13:42:59".
@ AllPages
All pages (except first and last if FirstPage or LastPage have their own headers)
static KDReports::HeaderLocations parseHeaderLocation(const QString &xmlAttr)
@ EvenPages
The even pages of the report: 2, 4, 6 etc.
@ OddPages
The odd pages of the report: 1 (unless FirstPage has its own header), 3, 5, 7 etc.
static Qt::AlignmentFlag stringToAlignment(const QString &str)
@ LastPage
The last page of the report.
@ LocaleDate
Current date in locale-dependent format, deprecated in favour of SystemLocaleShortDate or SystemLocal...
@ ISOTime
Current time in ISO 8601 format like "13:42:59".
@ ISODate
names but unlocalized order of names and numbers
static QColor readColor(const QDomElement &element, const char *attributeName)
static KDReports::VariableType stringToVariableType(const QString &type)