diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-09-18 14:50:03 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-09-18 15:11:07 +0300 |
commit | e26d82d56bc95d0e2b06bf41813e885486a2ea6c (patch) | |
tree | b495952484a52b78a40f64b6e28e145e925348ff /plugins/declarative/declarativechart.cpp | |
parent | 682630e62d588dace079a717e6cd4e43275a2db4 (diff) |
Misc fixes
- Default value for localizeNumbers is now false, as it would look
weird if numbers were localized in otherwise unlocalized app.
- Added locale property to qml ChartView.
- Added registrations for latest revisions of all QML types for 2.0,
since apparently this is necessary to make them visible when
importing Charts 2.0
Change-Id: I46997b3af4458c6dbf6755a19e01115d5393013a
Reviewed-by: Titta Heikkala <titta.heikkala@digia.com>
Diffstat (limited to 'plugins/declarative/declarativechart.cpp')
-rw-r--r-- | plugins/declarative/declarativechart.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp index b5b74c7c..fec441d5 100644 --- a/plugins/declarative/declarativechart.cpp +++ b/plugins/declarative/declarativechart.cpp @@ -180,7 +180,20 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE When \c{true}, all generated numbers appearing in various series and axis labels will be localized using the default QLocale of the application, which defaults to the system locale. When \c{false}, the "C" locale is always used. - Defaults to \c{true}. + Defaults to \c{false}. + + \sa locale +*/ + +/*! + \qmlproperty locale ChartView::locale + \since QtCharts 2.0 + Sets the locale used to format various chart labels when localizeNumbers is \c{true}. + This also determines the locale used to format DateTimeAxis labels regardless of + localizeNumbers property. + Defaults to application default locale at the time the chart is constructed. + + \sa localizeNumbers */ /*! @@ -732,6 +745,19 @@ bool DeclarativeChart::localizeNumbers() const return m_chart->localizeNumbers(); } +void QtCommercialChart::DeclarativeChart::setLocale(const QLocale &locale) +{ + if (m_chart->locale() != locale) { + m_chart->setLocale(locale); + emit localeChanged(); + } +} + +QLocale QtCommercialChart::DeclarativeChart::locale() const +{ + return m_chart->locale(); +} + int DeclarativeChart::count() { return m_chart->series().count(); |