summaryrefslogtreecommitdiffstats
path: root/src/charts/qchart.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-05-16 07:01:33 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-05-18 11:35:04 +0000
commit9787d0a16c3e6056691ac1dad1ec673a47179066 (patch)
treeb98443b7f4db0a2f2271512ae9287bba628bf2c9 /src/charts/qchart.cpp
parentd869201f06e02cc4bfc89c3b1765df2913396a12 (diff)
Add support for setting a plotarea rect
Change-Id: Iaa5cee58382b8290a7e36fd744a8af8bc29515b9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/charts/qchart.cpp')
-rw-r--r--src/charts/qchart.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/charts/qchart.cpp b/src/charts/qchart.cpp
index 3f8c3b49..6cce3611 100644
--- a/src/charts/qchart.cpp
+++ b/src/charts/qchart.cpp
@@ -223,7 +223,9 @@ QT_CHARTS_BEGIN_NAMESPACE
\property QChart::plotArea
\brief The rectangle within which the chart is drawn.
- The plot area does not include the area defined by margins.
+ The plot area does not include the area defined by margins. By default this will resize if inside
+ a QChartView. If an explicit size is set for the plot area then it will respect this, to revert
+ back to the default behavior, then calling \c{setPlotArea(QRectF());} will achieve this.
*/
/*!
@@ -583,6 +585,11 @@ QRectF QChart::plotArea() const
return d_ptr->m_presenter->geometry();
}
+void QChart::setPlotArea(const QRectF &rect)
+{
+ d_ptr->m_presenter->setFixedGeometry(rect);
+}
+
/*!
Sets the brush used to fill the background of the plot area of the chart to \a brush.