summaryrefslogtreecommitdiffstats
path: root/plugins/declarative/declarativechart.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-09-16 15:36:12 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-09-17 10:14:31 +0300
commitef2ab40bd1b9233ef398d0e6207d8537d2cd3b1a (patch)
treedb9a8f694a2863cd742bb0cbac63918b5f641ef7 /plugins/declarative/declarativechart.cpp
parent11c2ee82f698cde1462c1c3304d14423913cea42 (diff)
Added QChart::localizeNumbers
When this property is true, the default QLocale is used to convert various values to strings for series and axis labels instead of corresponding QString functions, which always use "C" locale. Task-number: QTRD-3231 Change-Id: I95a936ae6d49c2589a7c53a481fd850c90846ae4 Reviewed-by: Titta Heikkala <titta.heikkala@digia.com>
Diffstat (limited to 'plugins/declarative/declarativechart.cpp')
-rw-r--r--plugins/declarative/declarativechart.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp
index a9037085..3a9b8de3 100644
--- a/plugins/declarative/declarativechart.cpp
+++ b/plugins/declarative/declarativechart.cpp
@@ -175,6 +175,15 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE
*/
/*!
+ \qmlproperty bool ChartView::localizeNumbers
+ \since QtCharts 2.0
+ 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{false}.
+*/
+
+/*!
\qmlmethod AbstractSeries ChartView::series(int index)
Returns the series with \a index on the chart. This allows you to loop through the series of a chart together with
the count property of the chart.
@@ -710,6 +719,19 @@ QColor QtCommercialChart::DeclarativeChart::plotAreaColor()
return m_chart->plotAreaBackgroundBrush().color();
}
+void DeclarativeChart::setLocalizeNumbers(bool localize)
+{
+ if (m_chart->localizeNumbers() != localize) {
+ m_chart->setLocalizeNumbers(localize);
+ emit localizeNumbersChanged();
+ }
+}
+
+bool DeclarativeChart::localizeNumbers() const
+{
+ return m_chart->localizeNumbers();
+}
+
int DeclarativeChart::count()
{
return m_chart->series().count();