KTextTemplate
util.cpp
108 primitives << qMetaTypeId<KTextTemplate::SafeString>() << QMetaType::QString << QMetaType::Bool << QMetaType::Int << QMetaType::Double << QMetaType::Float
132 } else if (rhs.userType() == qMetaTypeId<KTextTemplate::SafeString>() && lhs.userType() == QMetaType::QString) {
150std::pair<qreal, QString> KTextTemplate::calcFileSize(qreal size, int unitSystem, qreal multiplier)
241 output += QStringLiteral("u\'") + static_cast<QString>(getSafeString(item).get()) + QLatin1Char('\'');
243 if ((item.userType() == qMetaTypeId<int>()) || (item.userType() == qMetaTypeId<uint>()) || (item.userType() == qMetaTypeId<double>())
A QString wrapper class for containing whether a string is safe or needs to be escaped.
Definition safestring.h:81
const NestedString & get() const
Returns the String held by this SafeString
Definition safestring.h:283
char * toString(const EngineQuery &query)
std::pair< qreal, QString > calcFileSize(qreal size, int unitSystem=10, qreal multiplier=1.0)
Converts size into the nearest file size unit like MB or MiB, based on the unitSystem value.
Definition util.cpp:150
KTextTemplate::SafeString markForEscaping(const KTextTemplate::SafeString &input)
Marks the input as requiring escaping.
Definition util.cpp:81
KTextTemplate::SafeString getSafeString(const QVariant &input)
Retrieves and returns a SafeString from the input.
Definition util.cpp:91
bool isSafeString(const QVariant &input)
Returns whether input contains a SafeString.
Definition util.cpp:99
bool variantIsTrue(const QVariant &variant)
Returns whether the variant is evaluated to true.
Definition util.cpp:24
QString unescapeStringLiteral(const QString &input)
Converts the input into its unescaped form.
Definition util.cpp:16
KTextTemplate::SafeString markSafe(const KTextTemplate::SafeString &input)
Marks the input as safe.
Definition util.cpp:74
bool equals(const QVariant &lhs, const QVariant &rhs)
Compares lhs and rhs for equality.
Definition util.cpp:119
bool supportedOutputType(const QVariant &input)
Returns true if the type of input can be inserted into a rendered template directly.
Definition util.cpp:113
QChar fromLatin1(char c)
const_iterator constBegin() const const
const_iterator constEnd() const const
Bool
bool isEmpty() const const
QString mid(qsizetype position, qsizetype n) const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
qsizetype size() const const
bool isValid() const const
int userType() const const
T value() const const
Utility functions used throughout KTextTemplate.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.