4#include "private/qqmltranslation_p.h"
13 using T = std::decay_t<
decltype(
arg)>;
14 if constexpr (!std::is_same_v<T, std::nullptr_t>)
15 return arg.translate();
17 Q_ASSERT_X(
false,
"QQmlTranslation",
"Uninitialized Translation");
28 using T = std::decay_t<
decltype(
arg)>;
29 if constexpr (!std::is_same_v<T, std::nullptr_t>)
30 return arg.serializeForQmltc();
32 Q_ASSERT_X(
false,
"QQmlTranslation",
"Uninitialized Translation");
43 using T = std::decay_t<
decltype(
arg)>;
44 if constexpr (!std::is_same_v<T, std::nullptr_t>)
45 return arg.idForQmlDebug();
47 Q_ASSERT_X(
false,
"QQmlTranslation",
"Uninitialized Translation");
62 int lastSlash = qmlFilename.lastIndexOf(
QLatin1Char(
'/'));
64 ?
QStringView{ qmlFilename }.
mid(lastSlash + 1, qmlFilename.size() - lastSlash - 5)
66 return contextView.toString();
71#if !QT_CONFIG(translation)
104#if !QT_CONFIG(translation)
114 QStringLiteral("%1"),
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
QString translate() const
QString idForQmlDebug() const
QsTrData(const QString &fileNameForContext, const QString &text, const QString &comment, int number)
QString serializeForQmltc() const
QString serializeForQmltc() const
QsTrIdData(const QString &id, int number)
QString translate() const
QString idForQmlDebug() const
QString idForQmlDebug() const
QString serializeForQmltc() const
static QString contextFromQmlFilename(const QString &qmlFilename)
std::variant< std::nullptr_t, QsTrData, QsTrIdData > Data
QString translate() const
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_ASSERT_X(cond, x, msg)
#define QStringLiteral(str)
Q_CORE_EXPORT QString qtTrId(const char *id, int n=-1)
\inmodule QtCore \reentrant