10#include <QtCore/private/qjnihelpers_p.h>
11#include <QtCore/QJniObject>
20using namespace QtJniTypes;
26void QAndroidSystemLocale::getLocaleFromJava()
const
28 const Locale javaLocaleObject = []{
30 if (javaContext.isValid()) {
31 const QJniObject resources = javaContext.callMethod<Resources>(
"getResources");
32 const QJniObject configuration = resources.callMethod<Configuration>(
"getConfiguration");
33 return configuration.getField<Locale>(
"locale");
35 return Locale::callStaticMethod<Locale>(
"getDefault");
39 const QString languageCode = javaLocaleObject.callMethod<
QString>(
"getLanguage");
40 const QString countryCode = javaLocaleObject.callMethod<
QString>(
"getCountry");
43 m_locale =
QLocale(languageCode + u
'_' + countryCode);
123 switch (
in.metaType().id()) {
126 case QMetaType::UInt:
128 case QMetaType::Double:
130 case QMetaType::LongLong:
132 case QMetaType::ULongLong:
149 LocaleList localeListObject = LocaleList::callStaticMethod<LocaleList>(
"getDefault");
150 if (localeListObject.isValid()) {
151 QString lang = localeListObject.callMethod<
QString>(
"toLanguageTags");
QVariant query(QueryType type, QVariant &&in) const override
QLocale fallbackLocale() const override
QString decimalPoint() const
QString quoteString(const QString &str, QuotationStyle style=StandardQuotation) const
QString dateTimeFormat(FormatType format=LongFormat) const
QString zeroDigit() const
QString dateFormat(FormatType format=LongFormat) const
QString negativeSign() const
Qt::DayOfWeek firstDayOfWeek() const
QString dayName(int, FormatType format=LongFormat) const
QString toCurrencyString(qlonglong, const QString &symbol=QString()) const
QString timeFormat(FormatType format=LongFormat) const
QString groupSeparator() const
QString createSeparatedList(const QStringList &strl) const
QString monthName(int, FormatType format=LongFormat) const
QString positiveSign() const
QString toString(qlonglong i) const
Returns a localized string representation of i.
QString standaloneMonthName(int, FormatType format=LongFormat) const
QString standaloneDayName(int, FormatType format=LongFormat) const
QString currencySymbol(CurrencySymbolFormat=CurrencySymbol) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
QString mid(qsizetype position, qsizetype n=-1) const &
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
qsizetype length() const noexcept
Returns the number of characters in this string.
@ StringToAlternateQuotation
@ StandaloneMonthNameLong
@ StandaloneDayNameNarrow
@ StandaloneMonthNameNarrow
@ StringToStandardQuotation
@ StandaloneMonthNameShort
Combined button and popup list for selecting options.
Q_CORE_EXPORT jint androidSdkVersion()
Q_CORE_EXPORT QtJniTypes::Context context()
#define Q_ASSERT_X(cond, x, msg)
QT_BEGIN_NAMESPACE Q_DECLARE_JNI_CLASS(Environment, "android/os/Environment")