本文整理汇总了C++中QLocale::script方法的典型用法代码示例。如果您正苦于以下问题:C++ QLocale::script方法的具体用法?C++ QLocale::script怎么用?C++ QLocale::script使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLocale
的用法示例。
在下文中一共展示了QLocale::script方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLocale
void InfoWidget::localeChanged(QLocale locale)
{
setLocale(locale);
name->setText(locale.name());
bcp47Name->setText(locale.bcp47Name());
languageName->setText(QLocale::languageToString(locale.language()));
nativeLanguageName->setText(locale.nativeLanguageName());
scriptName->setText(QLocale::scriptToString(locale.script()));
countryName->setText(QLocale::countryToString(locale.country()));
nativeCountryName->setText(locale.nativeCountryName());
}
示例2: displayName
QString QAndroidTimeZonePrivate::displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
const QLocale &locale) const
{
QString name;
if (androidTimeZone.isValid()) {
jboolean daylightTime = (timeType == QTimeZone::DaylightTime); // treat QTimeZone::GenericTime as QTimeZone::StandardTime
// treat all NameTypes as java TimeZone style LONG (value 1), except of course QTimeZone::ShortName which is style SHORT (value 0);
jint style = (nameType == QTimeZone::ShortName ? 0 : 1);
QJNIObjectPrivate jlanguage = QJNIObjectPrivate::fromString(QLocale::languageToString(locale.language()));
QJNIObjectPrivate jcountry = QJNIObjectPrivate::fromString(QLocale::countryToString(locale.country()));
QJNIObjectPrivate jvariant = QJNIObjectPrivate::fromString(QLocale::scriptToString(locale.script()));
QJNIObjectPrivate jlocale("java.util.Locale", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", static_cast<jstring>(jlanguage.object()), static_cast<jstring>(jcountry.object()), static_cast<jstring>(jvariant.object()));
QJNIObjectPrivate jname = androidTimeZone.callObjectMethod("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", daylightTime, style, jlocale.object());
name = jname.toString();
}
return name;
}