当前位置: 首页>>代码示例>>C++>>正文


C++ QLocale::script方法代码示例

本文整理汇总了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());
}
开发者ID:OniLink,项目名称:Qt5-Rehost,代码行数:11,代码来源:info.cpp

示例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;
}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:23,代码来源:qtimezoneprivate_android.cpp


注:本文中的QLocale::script方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。