From e26d82d56bc95d0e2b06bf41813e885486a2ea6c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 18 Sep 2014 14:50:03 +0300 Subject: 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 --- plugins/declarative/declarativechart.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'plugins/declarative/declarativechart.cpp') 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(); -- cgit v1.2.3