diff options
Diffstat (limited to 'src/qml/qml/qqmllocale_p.h')
-rw-r--r-- | src/qml/qml/qqmllocale_p.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h index d7bff5a1b7..a1acb2bad8 100644 --- a/src/qml/qml/qqmllocale_p.h +++ b/src/qml/qml/qqmllocale_p.h @@ -91,35 +91,32 @@ private: }; -class Q_QML_PRIVATE_EXPORT QQmlLocale +namespace QQmlLocale { - Q_GADGET + Q_NAMESPACE QML_NAMED_ELEMENT(Locale) - QML_UNCREATABLE("Locale cannot be instantiated. Use Qt.locale().") QML_ADDED_IN_VERSION(2, 2) -public: - ~QQmlLocale(); - enum MeasurementSystem { MetricSystem = QLocale::MetricSystem, ImperialSystem = QLocale::ImperialSystem, ImperialUSSystem = QLocale::ImperialUSSystem, ImperialUKSystem = QLocale::ImperialUKSystem }; - Q_ENUM(MeasurementSystem) + Q_ENUM_NS(MeasurementSystem) + enum FormatType { LongFormat = QLocale::LongFormat, ShortFormat = QLocale::ShortFormat, NarrowFormat = QLocale::NarrowFormat }; - Q_ENUM(FormatType) + Q_ENUM_NS(FormatType) enum CurrencySymbolFormat { CurrencyIsoCode = QLocale::CurrencyIsoCode, CurrencySymbol = QLocale::CurrencySymbol, CurrencyDisplayName = QLocale::CurrencyDisplayName }; - Q_ENUM(CurrencySymbolFormat) + Q_ENUM_NS(CurrencySymbolFormat) // Qt defines Sunday as 7, but JS Date assigns Sunday 0 enum DayOfWeek { Sunday = 0, @@ -130,7 +127,7 @@ public: Friday = Qt::Friday, Saturday = Qt::Saturday }; - Q_ENUM(DayOfWeek) + Q_ENUM_NS(DayOfWeek) enum NumberOptions { DefaultNumberOptions = QLocale::DefaultNumberOptions, OmitGroupSeparator = QLocale::OmitGroupSeparator, @@ -140,17 +137,12 @@ public: IncludeTrailingZeroesAfterDot = QLocale::IncludeTrailingZeroesAfterDot, RejectTrailingZeroesAfterDot = QLocale::RejectTrailingZeroesAfterDot }; - Q_ENUM(NumberOptions) - - static QV4::ReturnedValue locale(QV4::ExecutionEngine *engine, const QString &localeName); - static QV4::ReturnedValue wrap(QV4::ExecutionEngine *engine, const QLocale &locale); - - static void registerStringLocaleCompare(QV4::ExecutionEngine *engine); - -private: - QQmlLocale(); + Q_ENUM_NS(NumberOptions) - static QV4::ReturnedValue method_localeCompare(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc); + QV4::ReturnedValue locale(QV4::ExecutionEngine *engine, const QString &localeName); + QV4::ReturnedValue wrap(QV4::ExecutionEngine *engine, const QLocale &locale); + void registerStringLocaleCompare(QV4::ExecutionEngine *engine); + QV4::ReturnedValue method_localeCompare(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc); }; namespace QV4 { |