summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-06-04 08:59:15 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-06-04 09:07:45 +0300
commita58216ed7654bf1f3a825f5f1dc1d3da1c9a88f1 (patch)
treea6de5fad740053c04938280dd270bdcbcb50a04c /plugins
parentb76baa838f46089ff6d50a2f003b7903594fd443 (diff)
Added API to set chart background roundness
Task-number: QTRD-1631 Change-Id: I8ac70b5ed157211b90aa1c9ef3d168bca78fb27c Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/declarative/declarativechart.cpp18
-rw-r--r--plugins/declarative/declarativechart.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp
index bb62e077..a50a6df0 100644
--- a/plugins/declarative/declarativechart.cpp
+++ b/plugins/declarative/declarativechart.cpp
@@ -115,6 +115,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE
*/
/*!
+ \qmlproperty real ChartView::backgroundRoundness
+ The diameter of the rounding cirle at the corners of the chart background.
+*/
+
+/*!
\qmlproperty color ChartView::plotAreaColor
The color of the background of the chart's plot area. By default plot area background uses chart's
background color.
@@ -706,6 +711,19 @@ bool DeclarativeChart::dropShadowEnabled()
return m_chart->isDropShadowEnabled();
}
+qreal DeclarativeChart::backgroundRoundness() const
+{
+ return m_chart->backgroundRoundness();
+}
+
+void DeclarativeChart::setBackgroundRoundness(qreal diameter)
+{
+ if (m_chart->backgroundRoundness() != diameter) {
+ m_chart->setBackgroundRoundness(diameter);
+ emit backgroundRoundnessChanged(diameter);
+ }
+}
+
qreal DeclarativeChart::topMargin()
{
qWarning() << "ChartView.topMargin is deprecated. Use margins instead.";
diff --git a/plugins/declarative/declarativechart.h b/plugins/declarative/declarativechart.h
index 2717ee06..f24a7a98 100644
--- a/plugins/declarative/declarativechart.h
+++ b/plugins/declarative/declarativechart.h
@@ -53,6 +53,7 @@ class DeclarativeChart : public QDECLARATIVE_PAINTED_ITEM
Q_PROPERTY(int count READ count)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
Q_PROPERTY(bool dropShadowEnabled READ dropShadowEnabled WRITE setDropShadowEnabled NOTIFY dropShadowEnabledChanged)
+ Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness NOTIFY backgroundRoundnessChanged REVISION 3)
Q_PROPERTY(qreal topMargin READ topMargin)
Q_PROPERTY(qreal bottomMargin READ bottomMargin)
Q_PROPERTY(qreal leftMargin READ leftMargin)
@@ -143,6 +144,8 @@ public:
int count();
void setDropShadowEnabled(bool enabled);
bool dropShadowEnabled();
+ Q_REVISION(3) qreal backgroundRoundness() const;
+ Q_REVISION(3) void setBackgroundRoundness(qreal diameter);
// Margins & plotArea
qreal topMargin();
@@ -191,6 +194,7 @@ Q_SIGNALS:
void seriesAdded(QAbstractSeries *series);
void seriesRemoved(QAbstractSeries *series);
Q_REVISION(3) void plotAreaColorChanged();
+ Q_REVISION(3) void backgroundRoundnessChanged(qreal diameter);
private Q_SLOTS:
void changeMinimumMargins(int top, int bottom, int left, int right);