summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-12 18:38:23 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-12 18:38:23 +0100
commit4fc6ba92516f0a8f622da2160380a8c1fc5132ee (patch)
tree0b45c0f796020013533d6727f2631d3e0af7c846
parent34285c480f3ed811a4a58cf8ff0148c7f9698262 (diff)
parenta5b0ab930e595b7f1e24d5648bdda7872fc7980b (diff)
Merge remote-tracking branch 'origin/5.8' into dev
-rw-r--r--dist/changes-5.8.020
-rw-r--r--src/charts/areachart/qareaseries.cpp227
-rw-r--r--src/charts/axis/barcategoryaxis/qbarcategoryaxis.cpp117
-rw-r--r--src/charts/axis/categoryaxis/qcategoryaxis.cpp81
-rw-r--r--src/charts/axis/datetimeaxis/qdatetimeaxis.cpp92
-rw-r--r--src/charts/axis/logvalueaxis/qlogvalueaxis.cpp112
-rw-r--r--src/charts/axis/qabstractaxis.cpp270
-rw-r--r--src/charts/axis/valueaxis/qvalueaxis.cpp125
-rw-r--r--src/charts/barchart/horizontal/bar/qhorizontalbarseries.cpp23
-rw-r--r--src/charts/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp31
-rw-r--r--src/charts/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp21
-rw-r--r--src/charts/barchart/qabstractbarseries.cpp277
-rw-r--r--src/charts/barchart/qbarmodelmapper.cpp10
-rw-r--r--src/charts/barchart/qbarset.cpp209
-rw-r--r--src/charts/barchart/qhbarmodelmapper.cpp101
-rw-r--r--src/charts/barchart/qvbarmodelmapper.cpp107
-rw-r--r--src/charts/barchart/vertical/bar/qbarseries.cpp21
-rw-r--r--src/charts/barchart/vertical/percent/qpercentbarseries.cpp27
-rw-r--r--src/charts/barchart/vertical/stacked/qstackedbarseries.cpp18
-rw-r--r--src/charts/boxplotchart/qboxplotseries.cpp114
-rw-r--r--src/charts/boxplotchart/qboxset.cpp108
-rw-r--r--src/charts/candlestickchart/qcandlestickset.cpp2
-rw-r--r--src/charts/chartitem.cpp5
-rw-r--r--src/charts/chartitem_p.h2
-rw-r--r--src/charts/chartpresenter.cpp2
-rw-r--r--src/charts/doc/src/examples-areachart.qdoc4
-rw-r--r--src/charts/doc/src/examples-audio.qdoc2
-rw-r--r--src/charts/doc/src/examples-barchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-barmodelmapper.qdoc4
-rw-r--r--src/charts/doc/src/examples-boxplotchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-callout.qdoc2
-rw-r--r--src/charts/doc/src/examples-candlestickchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-chartthemes.qdoc2
-rw-r--r--src/charts/doc/src/examples-customchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-datetimeaxis.qdoc4
-rw-r--r--src/charts/doc/src/examples-donutbreakdown.qdoc4
-rw-r--r--src/charts/doc/src/examples-donutchart.qdoc2
-rw-r--r--src/charts/doc/src/examples-dynamicspline.qdoc2
-rw-r--r--src/charts/doc/src/examples-horizontalbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-horizontalpercentbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-horizontalstackedbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-legend.qdoc4
-rw-r--r--src/charts/doc/src/examples-legendmarkers.qdoc4
-rw-r--r--src/charts/doc/src/examples-lineandbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-linechart.qdoc4
-rw-r--r--src/charts/doc/src/examples-logvalueaxis.qdoc4
-rw-r--r--src/charts/doc/src/examples-modeldata.qdoc4
-rw-r--r--src/charts/doc/src/examples-multiaxis.qdoc4
-rw-r--r--src/charts/doc/src/examples-nesteddonuts.qdoc4
-rw-r--r--src/charts/doc/src/examples-openglseries.qdoc4
-rw-r--r--src/charts/doc/src/examples-percentbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-piechart.qdoc2
-rw-r--r--src/charts/doc/src/examples-piechartcustomization.qdoc2
-rw-r--r--src/charts/doc/src/examples-piechartdrilldown.qdoc2
-rw-r--r--src/charts/doc/src/examples-polarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmlaxes.qdoc5
-rw-r--r--src/charts/doc/src/examples-qmlchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmlcustomizations.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmlcustomlegend.qdoc5
-rw-r--r--src/charts/doc/src/examples-qmlf1legends.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmloscilloscope.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmlpolarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-qmlweather.qdoc4
-rw-r--r--src/charts/doc/src/examples-scatterchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-scatterinteractions.qdoc2
-rw-r--r--src/charts/doc/src/examples-splinechart.qdoc4
-rw-r--r--src/charts/doc/src/examples-stackedbarchart.qdoc4
-rw-r--r--src/charts/doc/src/examples-stackedbarchartdrilldown.qdoc4
-rw-r--r--src/charts/doc/src/examples-temperaturerecords.qdoc4
-rw-r--r--src/charts/doc/src/examples-zoomlinechart.qdoc4
-rw-r--r--src/charts/doc/src/index.qdoc14
-rw-r--r--src/charts/doc/src/qtcharts.qdoc8
-rw-r--r--src/charts/linechart/linechartitem.cpp8
-rw-r--r--src/charts/piechart/piechartitem.cpp60
-rw-r--r--src/charts/piechart/piechartitem_p.h9
-rw-r--r--src/charts/qabstractseries.cpp139
-rw-r--r--src/charts/qchartglobal.h5
-rw-r--r--src/charts/xychart/glxyseriesdata.cpp11
-rw-r--r--src/chartsqml2/declarativeboxplotseries.cpp176
-rw-r--r--src/chartsqml2/declarativechart.cpp2
-rw-r--r--src/chartsqml2/declarativechart.h6
-rw-r--r--src/chartsqml2/plugins.qmltypes424
-rw-r--r--sync.profile10
-rw-r--r--tests/auto/auto.pri1
-rw-r--r--tests/auto/inc/tst_definitions.h10
-rw-r--r--tests/auto/qareaseries/tst_qareaseries.cpp3
-rw-r--r--tests/auto/qbarseries/tst_qbarseries.cpp1
-rw-r--r--tests/auto/qcandlestickseries/tst_qcandlestickseries.cpp1
-rw-r--r--tests/auto/qchartview/tst_qchartview.cpp3
-rw-r--r--tests/auto/qhorizontalbarseries/tst_qhorizontalbarseries.cpp1
-rw-r--r--tests/auto/qhorizontalpercentbarseries/tst_qhorizontalpercentbarseries.cpp1
-rw-r--r--tests/auto/qhorizontalstackedbarseries/tst_qhorizontalstackedbarseries.cpp1
-rw-r--r--tests/auto/qlegend/tst_qlegend.cpp3
-rw-r--r--tests/auto/qml-qtquicktest/qml-qtquicktest.pro1
-rw-r--r--tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp1
-rw-r--r--tests/auto/qpieseries/tst_qpieseries.cpp8
-rw-r--r--tests/auto/qpieslice/tst_qpieslice.cpp1
-rw-r--r--tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp1
98 files changed, 1936 insertions, 1259 deletions
diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0
new file mode 100644
index 00000000..3916f238
--- /dev/null
+++ b/dist/changes-5.8.0
@@ -0,0 +1,20 @@
+Qt Charts 5.8.0
+
+New features
+------------
+- [QTBUG-50544] Added new candlestick series type
+- Added horizontal model mapper for box plot series
+
+Fixed issues
+------------
+- Antialiasing is now supported for OpenGL accelerated series
+- Mouse events are now supported for OpenGL accelerated series
+- [QTBUG-56037] Ensure axis geometry is correct when axis is shown
+- Fix areaseries bordercolor setting to black
+- [QTBUG-56900] Fix domain initialization for area series
+
+Example changes
+---------------
+- Qmlcustomizations example sometimes failed to run the animation
+- Fixed blinking after animation stopped in qmlcustomizations example
+- Fixed qmloscilloscope example when using software backend
diff --git a/src/charts/areachart/qareaseries.cpp b/src/charts/areachart/qareaseries.cpp
index 739efd71..c1e5bac6 100644
--- a/src/charts/areachart/qareaseries.cpp
+++ b/src/charts/areachart/qareaseries.cpp
@@ -43,16 +43,18 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QAreaSeries
\inmodule Qt Charts
- \brief The QAreaSeries class is used for making area charts.
+ \brief The QAreaSeries class presents data in area charts.
- An area series is used to show quantitative data. It is based on line series, in the way that
+ An area series is used to show quantitative data. It is based on a line series, in the way that
the area between the boundary lines is emphasized with color. Since the area series is based on
- line series, QAreaSeries constructor needs a QLineSeries instance, which defines "upper"
- boundary of the area. The area chart is drawn using the bottom of the plot area as the "lower"
- boundary by default. Instead of the bottom of the plot area, the "lower" boundary can be
- specified by another line. In that case QAreaSeries should be initialized with two QLineSeries
- instances. Please note that the terms "upper" and "lower" boundary can be misleading in cases
- where the "lower" boundary has bigger values than the "upper" one. The main point is that the
+ the line series, the QAreaSeries constructor needs a QLineSeries instance, which defines the
+ \e upper boundary of the area. The area chart is drawn using the bottom of the plot area as the
+ \e lower boundary by default. Instead of the bottom of the plot area, the lower boundary can be
+ specified by another line. In that case, QAreaSeries should be initialized with two QLineSeries
+ instances.
+
+ \note The terms \e upper and \e lower boundary can be misleading in cases where the value of the
+ lower boundary is greater than that of the upper boundary. The main point is that the
area between these two boundary lines will be filled.
See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart.
@@ -66,7 +68,7 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractSeries
- \brief The AreaSeries type is used for making area charts.
+ \brief Presents data in area charts.
The following QML shows how to create a simple area chart:
\snippet qmlchart/qml/qmlchart/View4.qml 1
@@ -75,7 +77,7 @@ QT_CHARTS_BEGIN_NAMESPACE
\endfloat
\clearfloat
- \note Adding the same line series to chart and area series is not supported. The series used as
+ \note Adding the same line series to a chart and area series is not supported. The series used as
boundary lines should be defined only for the area series.
*/
@@ -90,18 +92,21 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAreaSeries::lowerSeries
- The lower one of the two line series used to define are series boundaries. Note if
- QAreaSeries was constructed without a\ lowerSeries this is null.
+ \brief The lower one of the two line series used to define area series boundaries.
+
+ \note If QAreaSeries was constructed without a\ lowerSeries, this is null.
*/
/*!
\qmlproperty LineSeries AreaSeries::lowerSeries
- The lower one of the two line series used to define are series boundaries. Note if
- AreaSeries was constructed without a\ lowerSeries this is null.
+ The lower one of the two line series used to define area series boundaries.
+
+ \note If AreaSeries was constructed without a\ lowerSeries, this is null.
*/
/*!
\property QAreaSeries::color
- Fill (brush) color of the series. This is a convenience property for modifying the color of brush.
+ \brief The fill (brush) color of the series. This is a convenience property for modifying the
+ color of the brush.
\sa QAreaSeries::brush()
*/
/*!
@@ -111,7 +116,8 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAreaSeries::borderColor
- Line (pen) color of the series. This is a convenience property for modifying the color of pen.
+ \brief The line (pen) color of the series. This is a convenience property for modifying the
+ color of the pen.
\sa QAreaSeries::pen()
*/
/*!
@@ -121,18 +127,18 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlproperty real AreaSeries::borderWidth
- The width of the border line. By default the width is 2.0.
+ The width of the border line. By default, the width is 2.0.
*/
/*!
\fn QPen QAreaSeries::pen() const
- \brief Returns the pen used to draw line for this series.
+ \brief Returns the pen used to draw the line for this series.
\sa setPen()
*/
/*!
\fn QPen QAreaSeries::brush() const
- \brief Returns the brush used to draw line for this series.
+ \brief Returns the brush used to draw the line for this series.
\sa setBrush()
*/
@@ -143,103 +149,99 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\fn void QAreaSeries::colorChanged(QColor color)
- \brief Signal is emitted when the fill (brush) color has changed to \a color.
+ \brief This signal is emitted when the fill (brush) color changes to \a color.
*/
/*!
\qmlsignal AreaSeries::onColorChanged(color color)
- Signal is emitted when the fill (brush) color has changed to \a color.
+ This signal is emitted when the fill (brush) color changes to \a color.
*/
/*!
\fn void QAreaSeries::borderColorChanged(QColor color)
- \brief Signal is emitted when the line (pen) color has changed to \a color.
+ \brief This signal is emitted when the line (pen) color changes to \a color.
*/
/*!
\qmlsignal AreaSeries::onBorderColorChanged(color color)
- Signal is emitted when the line (pen) color has changed to \a color.
+ This signal is emitted when the line (pen) color changes to \a color.
*/
/*!
\fn void QAreaSeries::clicked(const QPointF& point)
- \brief Signal is emitted when user clicks the \a point on area chart. The \a point is the point
- where the press was triggered.
+ \brief This signal is emitted when the user triggers a press on \a point by clicking it in an
+ area chart.
\sa pressed, released, doubleClicked
*/
/*!
\qmlsignal AreaSeries::onClicked(QPointF point)
- Signal is emitted when user clicks the \a point on area chart. The \a point is the point where
- the press was triggered.
+ This signal is emitted when the user triggers a press on \a point by clicking it in an
+ area chart.
\sa onPressed, onReleased, onDoubleClicked
*/
/*!
\fn void QAreaSeries::hovered(const QPointF &point, bool state)
- This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate)
- of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from
- the series.
+ This signal is emitted when the user hovers the mouse cursor over a series or moves it away from
+ the series. \a point shows the origin (coordinate) of the hover event. \a state is \c true when
+ the cursor hovers over the series and turns \e false when it moves away from the series.
*/
/*!
\qmlsignal AreaSeries::onHovered(point point, bool state)
- This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate)
- of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from
- the series.
+ This signal is emitted when the user hovers the mouse cursor over a series or moves it away from
+ the series. \a point shows the origin (coordinate) of the hover event. \a state is \c true when
+ the cursor hovers over the series and turns \e false when it moves away from the series.
*/
/*!
\fn void QAreaSeries::pressed(const QPointF& point)
- \brief Signal is emitted when user presses the \a point on area chart.
+ \brief This signal is emitted when the user presses the point specified by \a point
+ in an area chart.
\sa clicked, released, doubleClicked
*/
/*!
\qmlsignal AreaSeries::onPressed(QPointF point)
- Signal is emitted when user presses the \a point on area chart.
+ This signal is emitted when the user presses the point specified by \a point in an area chart.
\sa onClicked, onReleased, onDoubleClicked
*/
/*!
\fn void QAreaSeries::released(const QPointF& point)
- \brief Signal is emitted when user releases a press that was triggered on a \a point on area
- chart.
+ \brief This signal is emitted when the user releases a press that was triggered on
+ \a point in an area chart.
\sa pressed, clicked, doubleClicked
*/
/*!
\qmlsignal AreaSeries::onReleased(QPointF point)
- Signal is emitted when user releases a press that was triggered on a \a point on area chart.
+ This signal is emitted when the user releases a press that was triggered on
+ \a point in an area chart.
\sa onPressed, onClicked, onDoubleClicked
*/
/*!
\fn void QAreaSeries::doubleClicked(const QPointF& point)
- \brief Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the
- point where the first press was triggered.
+ \brief This signal is emitted when the user triggers the first press in an area chart
+ by doubleclicking \a point.
\sa pressed, released, clicked
*/
/*!
\qmlsignal AreaSeries::onDoubleClicked(QPointF point)
- Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the point
- where the first press was triggered.
+ This signal is emitted when the user triggers the first press in an area chart
+ by doubleclicking \a point.
\sa onPressed, onReleased, onClicked
*/
/*!
\fn void QAreaSeries::selected()
- The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be
- implemented by the user of QAreaSeries API.
-*/
-/*!
- \qmlsignal AreaSeries::onSelected()
- The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be
- implemented by the user of AreaSeries API.
+ \internal
*/
/*!
\fn void QAreaSeriesPrivate::updated()
- \brief \internal
+ \internal
*/
/*!
\property QAreaSeries::pointLabelsFormat
- The \a format used for showing labels with series points.
+ \brief The format used for showing labels with series points.
QAreaSeries supports the following format tags:
\table
@@ -255,51 +257,51 @@ QT_CHARTS_BEGIN_NAMESPACE
series->setPointLabelsFormat("(@xPoint, @yPoint)");
\endcode
- By default, the labels format is set to '@xPoint, @yPoint'. The labels are shown on the plot
- area, labels on the edge of the plot area are cut. If the points are close to each other the
- labels may overlap.
+ By default, the label format is set to \c{@xPoint, @yPoint}. The labels are shown on the plot
+ area, whereas labels on the edge of the plot area are cut. If the points are close to each
+ other, the labels may overlap.
\sa QAreaSeries::pointLabelsVisible, QAreaSeries::pointLabelsFont, QAreaSeries::pointLabelsColor
*/
/*!
\qmlproperty string AreaSeries::pointLabelsFormat
- The \a format used for showing labels with series points.
+ The format used for showing labels with series points.
\sa QAreaSeries::pointLabelsFormat, pointLabelsVisible, pointLabelsFont, pointLabelsColor
*/
/*!
\fn void QAreaSeries::pointLabelsFormatChanged(const QString &format)
- Signal is emitted when the \a format of data point labels is changed.
+ This signal is emitted when the \a format of data point labels is changed.
*/
/*!
\qmlsignal AreaSeries::onPointLabelsFormatChanged(string format)
- Signal is emitted when the \a format of data point labels is changed.
+ This signal is emitted when the \a format of data point labels is changed.
*/
/*!
\property QAreaSeries::pointLabelsVisible
- Defines the visibility for data point labels. False by default.
+ \brief The visibility of data point labels. False by default.
\sa QAreaSeries::pointLabelsFormat, QAreaSeries::pointLabelsClipping
*/
/*!
\qmlproperty bool AreaSeries::pointLabelsVisible
- Defines the visibility for data point labels.
+ Defines the visibility of data point labels.
\sa pointLabelsFormat, pointLabelsClipping
*/
/*!
\fn void QAreaSeries::pointLabelsVisibilityChanged(bool visible)
- The visibility of the data point labels is changed to \a visible.
+ This signal is emitted when the visibility of the data point labels changes to \a visible.
*/
/*!
\qmlsignal AreaSeries::onPointLabelsVisibilityChanged(bool visible)
- The visibility of the data point labels is changed to \a visible.
+ This signal is emitted when the visibility of the data point labels changes to \a visible.
*/
/*!
\property QAreaSeries::pointLabelsFont
- Defines the font used for data point labels.
+ \brief The font used for data point labels.
\sa QAreaSeries::pointLabelsFormat
*/
@@ -311,39 +313,39 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\fn void QAreaSeries::pointLabelsFontChanged(const QFont &font);
- The font used for data point labels is changed to \a font.
+ This signal is emitted when the font used for data point labels changes to \a font.
*/
/*!
\qmlsignal AreaSeries::onPointLabelsFontChanged(Font font)
- The font used for data point labels is changed to \a font.
+ This signal is emitted when the font used for data point labels changes to \a font.
*/
/*!
\property QAreaSeries::pointLabelsColor
- Defines the color used for data point labels. By default, the color is the color of the brush
- defined in theme for labels.
+ \brief The color used for data point labels. By default, the color is the color of the brush
+ defined for labels in the theme.
\sa QAreaSeries::pointLabelsFormat
*/
/*!
\qmlproperty font AreaSeries::pointLabelsColor
Defines the color used for data point labels. By default, the color is the color of the brush
- defined in theme for labels.
+ defined for labels in the theme.
\sa pointLabelsFormat
*/
/*!
\fn void QAreaSeries::pointLabelsColorChanged(const QColor &color);
- The color used for data point labels is changed to \a color.
+ This signal is emitted when the color used for data point labels changes to \a color.
*/
/*!
\qmlsignal AreaSeries::onPointLabelsColorChanged(Color color)
- The color used for data point labels is changed to \a color.
+ This signal is emitted when the color used for data point labels changes to \a color.
*/
/*!
\property QAreaSeries::pointLabelsClipping
- Defines the clipping for data point labels. True by default. The labels on the edge of the plot
+ \brief The clipping for data point labels. True by default. The labels on the edge of the plot
area are cut when clipping is enabled.
\sa pointLabelsVisible
@@ -357,17 +359,20 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\fn void QAreaSeries::pointLabelsClippingChanged(bool clipping)
- The clipping of the data point labels is changed to \a clipping.
+ This signal is emitted when the clipping of the data point labels changes to \a clipping.
*/
/*!
\qmlsignal AreaSeries::onPointLabelsClippingChanged(bool clipping)
- The clipping of the data point labels is changed to \a clipping.
+ This signal is emitted when the clipping of the data point labels changes to \a clipping.
*/
/*!
- Constructs area series object which is a child of \a upperSeries. Area will be spanned between \a
- upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead.
- When series object is added to QChartView or QChart instance ownerships is transferred.
+ Constructs an area series object that will be spanned between an \a upperSeries line and a
+ \a lowerSeries line. If no \a lowerSeries is passed to the constructor, the x-axis is used
+ as the lower bound instead.
+
+ The QAreaSeries does not own the upper or lower series, but the ownership stays with the caller.
+ When the series object is added to QChartView or QChart, the instance ownership is transferred.
*/
QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries)
: QAbstractSeries(*new QAreaSeriesPrivate(upperSeries, lowerSeries, this), upperSeries)
@@ -379,7 +384,7 @@ QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries)
}
/*!
- Constructs area series object without upper or lower series with \a parent object.
+ Constructs an area series object without an upper or a lower series with the \a parent object.
*/
QAreaSeries::QAreaSeries(QObject *parent)
: QAbstractSeries(*new QAreaSeriesPrivate(0, 0, this), parent)
@@ -449,14 +454,17 @@ QLineSeries *QAreaSeries::lowerSeries() const
}
/*!
- Sets \a pen used for drawing area outline.
+ Sets the \a pen used for drawing the area outline.
*/
void QAreaSeries::setPen(const QPen &pen)
{
Q_D(QAreaSeries);
if (d->m_pen != pen) {
+ bool emitColorChanged = pen.color() != d->m_pen.color();
d->m_pen = pen;
emit d->updated();
+ if (emitColorChanged)
+ emit borderColorChanged(pen.color());
}
}
@@ -470,7 +478,7 @@ QPen QAreaSeries::pen() const
}
/*!
- Sets \a brush used for filling the area.
+ Sets the \a brush used for filling the area.
*/
void QAreaSeries::setBrush(const QBrush &brush)
{
@@ -510,11 +518,8 @@ QColor QAreaSeries::color() const
void QAreaSeries::setBorderColor(const QColor &color)
{
QPen p = pen();
- if (p.color() != color) {
- p.setColor(color);
- setPen(p);
- emit borderColorChanged(color);
- }
+ p.setColor(color);
+ setPen(p);
}
QColor QAreaSeries::borderColor() const
@@ -523,7 +528,7 @@ QColor QAreaSeries::borderColor() const
}
/*!
- Sets if data points are \a visible and should be drawn on line.
+ Determines whether data points are \a visible and should be drawn on the line.
*/
void QAreaSeries::setPointsVisible(bool visible)
{
@@ -535,7 +540,7 @@ void QAreaSeries::setPointsVisible(bool visible)
}
/*!
- Returns if the points are drawn for this series.
+ Returns whether the points are drawn for this series.
\sa setPointsVisible()
*/
bool QAreaSeries::pointsVisible() const
@@ -643,10 +648,10 @@ void QAreaSeriesPrivate::initializeDomain()
{
Q_Q(QAreaSeries);
- qreal minX(domain()->minX());
- qreal minY(domain()->minY());
- qreal maxX(domain()->maxX());
- qreal maxY(domain()->maxY());
+ qreal minX(0.0);
+ qreal minY(0.0);
+ qreal maxX(1.0);
+ qreal maxY(1.0);
QLineSeries *upperSeries = q->upperSeries();
QLineSeries *lowerSeries = q->lowerSeries();
@@ -654,25 +659,41 @@ void QAreaSeriesPrivate::initializeDomain()
if (upperSeries) {
const QVector<QPointF> &points = upperSeries->pointsVector();
- for (int i = 0; i < points.count(); i++) {
- qreal x = points[i].x();
- qreal y = points[i].y();
- minX = qMin(minX, x);
- minY = qMin(minY, y);
- maxX = qMax(maxX, x);
- maxY = qMax(maxY, y);
+ if (!points.isEmpty()) {
+ minX = points[0].x();
+ minY = points[0].y();
+ maxX = minX;
+ maxY = minY;
+
+ for (int i = 0; i < points.count(); i++) {
+ qreal x = points[i].x();
+ qreal y = points[i].y();
+ minX = qMin(minX, x);
+ minY = qMin(minY, y);
+ maxX = qMax(maxX, x);
+ maxY = qMax(maxY, y);
+ }
}
}
if (lowerSeries) {
const QVector<QPointF> &points = lowerSeries->pointsVector();
- for (int i = 0; i < points.count(); i++) {
- qreal x = points[i].x();
- qreal y = points[i].y();
- minX = qMin(minX, x);
- minY = qMin(minY, y);
- maxX = qMax(maxX, x);
- maxY = qMax(maxY, y);
+ if (!points.isEmpty()) {
+ if (!upperSeries) {
+ minX = points[0].x();
+ minY = points[0].y();
+ maxX = minX;
+ maxY = minY;
+ }
+
+ for (int i = 0; i < points.count(); i++) {
+ qreal x = points[i].x();
+ qreal y = points[i].y();
+ minX = qMin(minX, x);
+ minY = qMin(minY, y);
+ maxX = qMax(maxX, x);
+ maxY = qMax(maxY, y);
+ }
}
}
diff --git a/src/charts/axis/barcategoryaxis/qbarcategoryaxis.cpp b/src/charts/axis/barcategoryaxis/qbarcategoryaxis.cpp
index 4a8f8a86..1c5ec1a8 100644
--- a/src/charts/axis/barcategoryaxis/qbarcategoryaxis.cpp
+++ b/src/charts/axis/barcategoryaxis/qbarcategoryaxis.cpp
@@ -39,13 +39,13 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QBarCategoryAxis
\inmodule Qt Charts
- \brief The QBarCategoryAxis class is used for manipulating chart's axis.
+ \brief The QBarCategoryAxis class adds categories to a chart's axes.
- QBarCategoryAxis can be setup to show axis line with tick marks, grid lines and shades.
- Categories are drawn between ticks. Note that you can use this also with lineseries too.
- See the \l {Line and BarChart Example} {Line and BarChart Example} to learn how to do that.
+ QBarCategoryAxis can be set up to show an axis line with tick marks, grid lines, and shades.
+ Categories are drawn between the ticks. It can be used also with a line series, as demonstrated
+ by the \l {Line and BarChart Example} {Line and BarChart Example}.
- Example code on how to use QBarCategoryAxis.
+ The following code illustrates how to use QBarCategoryAxis:
\code
QChartView *chartView = new QChartView;
QBarSeries *series = new QBarSeries;
@@ -69,12 +69,12 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractAxis
- \brief The Axis element is used for manipulating chart's axes.
+ \brief Adds categories to a chart's axes.
- Axis can be setup to show axis line with tick marks, grid lines and shades.
- Categories are drawn between ticks. Note that you can use this also with lineseries too.
+ The BarCategoryAxis type can be set up to show an axis line with tick marks, grid lines, and
+ shades. Categories are drawn between the ticks. It can be used also with a line series.
- To access BarCategoryAxis you can use ChartView API. For example:
+ The following QML snippet illustrates how to use BarCategoryAxis:
\code
ChartView {
BarCategoryAxis {
@@ -88,84 +88,84 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QBarCategoryAxis::categories
- Defines the categories of axis
+ \brief The categories of an axis.
*/
/*!
\qmlproperty QStringList BarCategoryAxis::categories
- Defines the categories of axis
+ The categories of an axis.
*/
/*!
\property QBarCategoryAxis::min
- Defines the minimum value on the axis.
+ \brief The minimum value on the axis.
*/
/*!
\qmlproperty string BarCategoryAxis::min
- Defines the minimum value on the axis.
+ The minimum value on the axis.
*/
/*!
\property QBarCategoryAxis::max
- Defines the maximum value on the axis.
+ \brief The maximum value on the axis.
*/
/*!
\qmlproperty string BarCategoryAxis::max
- Defines the maximum value on the axis.
+ The maximum value on the axis.
*/
/*!
\property QBarCategoryAxis::count
- The count of categories.
+ \brief The number of categories of an axis.
*/
/*!
\qmlproperty int BarCategoryAxis::count
- The count of categories.
+ The number of categories of an axis.
*/
/*!
\fn void QBarCategoryAxis::categoriesChanged()
- Axis emits signal when the categories of the axis have changed.
+ This signal is emitted when the categories of the axis change.
*/
/*!
\fn void QBarCategoryAxis::minChanged(const QString &min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the \a min value of the axis changes.
*/
/*!
\qmlsignal BarCategoryAxis::onMinChanged(const QString &min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the \a min value of the axis changes.
*/
/*!
\fn void QBarCategoryAxis::maxChanged(const QString &max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the \a max value of the axis changes.
*/
/*!
\qmlsignal BarCategoryAxis::onMaxChanged(const QString &max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the \a max of the axis changes.
*/
/*!
\fn void QBarCategoryAxis::countChanged()
- Axis emits signal when the count of categories has changed.
+ This signal is emitted when the number of categories of an axis changes.
*/
/*!
\qmlsignal BarCategoryAxis::onCountChanged()
- Axis emits signal when the count of categories has changed.
+ This signal is emitted when the number of categories of an axis changes.
*/
/*!
\fn void QBarCategoryAxis::rangeChanged(const QString &min, const QString &max)
- Axis emits signal when \a min or \a max of axis has changed.
+ This signal is emitted when \a min or \a max value of the axis changes.
*/
/*!
\qmlmethod void BarCategoryAxis::clear()
- Removes all categories. Sets the maximum and minimum of the axis's range to QString::null.
+ Removes all categories. Sets the maximum and minimum values of the axis range to QString::null.
*/
/*!
- Constructs an axis object which is a child of \a parent.
+ Constructs an axis object that is the child of \a parent.
*/
QBarCategoryAxis::QBarCategoryAxis(QObject *parent):
QAbstractAxis(*new QBarCategoryAxisPrivate(this), parent)
@@ -173,7 +173,7 @@ QBarCategoryAxis::QBarCategoryAxis(QObject *parent):
}
/*!
- Destroys the object
+ Destroys the axis object.
*/
QBarCategoryAxis::~QBarCategoryAxis()
{
@@ -192,9 +192,13 @@ QBarCategoryAxis::QBarCategoryAxis(QBarCategoryAxisPrivate &d, QObject *parent)
}
/*!
- Appends \a categories to axis. A maximum of the axis will be changed to last category in \a categories.
- If there were no categories previously defined, minimum of axis will be also changed to first category in \a categories.
- A category has to be valid QStrings and can not be duplicated. Duplicated categories will not be appended.
+ Appends \a categories to an axis. The maximum value on the axis will be changed
+ to match the last category in \a categories. If no categories were previously defined,
+ the minimum value on the axis will also be changed to match the first category in
+ \a categories.
+
+ A category has to be a valid QString and it cannot be duplicated. Duplicated
+ categories will not be appended.
*/
void QBarCategoryAxis::append(const QStringList &categories)
{
@@ -224,9 +228,12 @@ void QBarCategoryAxis::append(const QStringList &categories)
}
/*!
- Appends \a category to axis. A maximum of the axis will be changed to last \a category.
- If there were no categories previously defined, minimum of axis will be also changed to \a category.
- A \a category has to be valid QStrings and can not be duplicated. Duplicated categories will not be appended.
+ Appends \a category to an axis. The maximum value on the axis will be changed
+ to match the last \a category. If no categories were previously defined, the minimum
+ value on the axis will also be changed to match \a category.
+
+ A category has to be a valid QString and it cannot be duplicated. Duplicated
+ categories will not be appended.
*/
void QBarCategoryAxis::append(const QString &category)
{
@@ -250,8 +257,8 @@ void QBarCategoryAxis::append(const QString &category)
}
/*!
- Removes \a category from axis. Removing category which is currently maximum or minimum
- will affect the axis range.
+ Removes \a category from the axis. Removing a category that currently sets the
+ maximum or minimum value on the axis will affect the axis range.
*/
void QBarCategoryAxis::remove(const QString &category)
{
@@ -276,8 +283,9 @@ void QBarCategoryAxis::remove(const QString &category)
}
/*!
- Inserts \a category to axis at \a index. A \a category has to be valid QStrings and can not be duplicated.
- If \a category is prepended or appended to categories, minimum and maximum of axis is updated accordingly.
+ Inserts \a category to the axis at \a index. \a category has to be a valid QString
+ and it cannot be duplicated. If \a category is prepended or appended to other
+ categories, the minimum and maximum values on the axis are updated accordingly.
*/
void QBarCategoryAxis::insert(int index, const QString &category)
{
@@ -306,9 +314,10 @@ void QBarCategoryAxis::insert(int index, const QString &category)
}
/*!
- Replaces \a oldCategory with \a newCategory. If \a oldCategory does not exist on the axis nothing is done.
- A \a newCategory has to be valid QStrings and can not be duplicated. In case of replacing minimum or maximum category,
- minimum and maximum of axis is updated accordingly.
+ Replaces \a oldCategory with \a newCategory. If \a oldCategory does not exist on the axis,
+ nothing is done. \a newCategory has to be a valid QString and it cannot be duplicated. If
+ the minimum or maximum category is replaced, the minimum and maximum values on the axis are
+ updated accordingly.
*/
void QBarCategoryAxis::replace(const QString &oldCategory, const QString &newCategory)
{
@@ -329,7 +338,7 @@ void QBarCategoryAxis::replace(const QString &oldCategory, const QString &newCat
}
/*!
- Removes all categories. Sets the maximum and minimum of the axis's range to QString::null.
+ Removes all categories. Sets the maximum and minimum values of the axis range to QString::null.
*/
void QBarCategoryAxis::clear()
{
@@ -341,8 +350,10 @@ void QBarCategoryAxis::clear()
}
/*!
- Set \a categories and discards the old ones, range of axis is adjusted to match first and last category in \a categories.
- A category has to be valid QStrings and can not be duplicated.
+ Sets \a categories and discards the old ones. The axis range is adjusted to match the
+ first and last category in \a categories.
+
+ A category has to be a valid QString and it cannot be duplicated.
*/
void QBarCategoryAxis::setCategories(const QStringList &categories)
{
@@ -357,7 +368,7 @@ void QBarCategoryAxis::setCategories(const QStringList &categories)
}
/*!
- Returns categories
+ Returns categories.
*/
QStringList QBarCategoryAxis::categories()
{
@@ -366,7 +377,7 @@ QStringList QBarCategoryAxis::categories()
}
/*!
- Returns number of categories.
+ Returns the number of categories.
*/
int QBarCategoryAxis::count() const
{
@@ -375,7 +386,7 @@ int QBarCategoryAxis::count() const
}
/*!
- Returns category at \a index. Index must be valid.
+ Returns the category at \a index. The index must be valid.
*/
QString QBarCategoryAxis::at(int index) const
{
@@ -384,7 +395,7 @@ QString QBarCategoryAxis::at(int index) const
}
/*!
- Sets minimum category to \a min.
+ Sets the minimum category to \a min.
*/
void QBarCategoryAxis::setMin(const QString &min)
{
@@ -393,7 +404,7 @@ void QBarCategoryAxis::setMin(const QString &min)
}
/*!
- Returns minimum category.
+ Returns the minimum category.
*/
QString QBarCategoryAxis::min() const
{
@@ -402,7 +413,7 @@ QString QBarCategoryAxis::min() const
}
/*!
- Sets maximum category to \a max.
+ Sets the maximum category to \a max.
*/
void QBarCategoryAxis::setMax(const QString &max)
{
@@ -411,7 +422,7 @@ void QBarCategoryAxis::setMax(const QString &max)
}
/*!
- Returns maximum category
+ Returns the maximum category.
*/
QString QBarCategoryAxis::max() const
{
@@ -420,7 +431,7 @@ QString QBarCategoryAxis::max() const
}
/*!
- Sets range from \a minCategory to \a maxCategory
+ Sets the axis range from \a minCategory to \a maxCategory.
*/
void QBarCategoryAxis::setRange(const QString &minCategory, const QString &maxCategory)
{
@@ -429,7 +440,7 @@ void QBarCategoryAxis::setRange(const QString &minCategory, const QString &maxCa
}
/*!
- Returns the type of the axis
+ Returns the type of the axis.
*/
QAbstractAxis::AxisType QBarCategoryAxis::type() const
{
diff --git a/src/charts/axis/categoryaxis/qcategoryaxis.cpp b/src/charts/axis/categoryaxis/qcategoryaxis.cpp
index e9eff189..4a039b49 100644
--- a/src/charts/axis/categoryaxis/qcategoryaxis.cpp
+++ b/src/charts/axis/categoryaxis/qcategoryaxis.cpp
@@ -41,10 +41,11 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QCategoryAxis
\inmodule Qt Charts
- \brief The QCategoryAxis class allows putting a named ranges on the axis.
+ \brief The QCategoryAxis class places named ranges on the axis.
- This class can be used when the underlying data needs to be given extra meaning.
- Unlike with the QBarCategoryAxis the QCategoryAxis allows the categories ranges widths to be specified freely.
+ This class can be used to explain the underlying data by adding labeled categories.
+ Unlike QBarCategoryAxis, QCategoryAxis allows the widths of the category ranges to
+ be specified freely.
Example code on how to use QCategoryAxis:
\image api_category_axis.png
@@ -70,7 +71,10 @@ QT_CHARTS_BEGIN_NAMESPACE
\inqmlmodule QtCharts
\inherits AbstractAxis
- \brief CategoryAxis allows putting a named ranges on the axis.
+ \brief CategoryAxis places named ranges on the axis.
+
+ This type can be used to explain the underlying data by adding labeled categories.
+ The widths of the category ranges can be specified freely.
For example:
\image examples_qmlaxes3.png
@@ -79,25 +83,25 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QCategoryAxis::startValue
- Defines the low end of the first category on the axis.
+ \brief The low end of the first category on the axis.
*/
/*!
\qmlproperty int CategoryAxis::startValue
- Defines the low end of the first category on the axis.
+ The low end of the first category on the axis.
*/
/*!
\property QCategoryAxis::count
- The count of categories.
+ \brief The number of categories.
*/
/*!
\qmlproperty int CategoryAxis::count
- The count of categories.
+ The number of categories.
*/
/*!
\property QCategoryAxis::categoriesLabels
- The category labels as a string list.
+ \brief The category labels as a string list.
*/
/*!
\qmlproperty StringList CategoryAxis::categoriesLabels
@@ -106,7 +110,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\fn void QCategoryAxis::categoriesChanged()
- Axis emits signal when the categories of the axis have changed.
+ This signal is emitted when the categories of the axis change.
*/
/*!
@@ -119,18 +123,24 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\property QCategoryAxis::labelsPosition
- Defines the position of the category labels. The labels in the beginning and in the end of the
- axes may overlap other axes labels when positioned on value.
+ \brief The position of the category labels. The labels in the beginning and in the end of the
+ axes may overlap other axes' labels when positioned on value.
*/
/*!
- \qmlproperty AxisLabelsPosition CategoryAxis::labelsPosition
- Defines the position of the category labels. The labels in the beginning and in the end of the
- axes may overlap other axes labels when positioned on value.
+ \qmlproperty enumeration CategoryAxis::labelsPosition
+
+ The position of the category labels. The labels in the beginning and in the end of the
+ axes may overlap other axes' labels when positioned on value.
+
+ \value CategoryAxis.AxisLabelsPositionCenter
+ Labels are centered to category.
+ \value CategoryAxis.AxisLabelsPositionOnValue
+ Labels are positioned to the high end limit of the category.
*/
/*!
- Constructs an axis object which is a child of \a parent.
+ Constructs an axis object that is a child of \a parent.
*/
QCategoryAxis::QCategoryAxis(QObject *parent):
QValueAxis(*new QCategoryAxisPrivate(this), parent)
@@ -138,7 +148,7 @@ QCategoryAxis::QCategoryAxis(QObject *parent):
}
/*!
- Destroys the object
+ Destroys the object.
*/
QCategoryAxis::~QCategoryAxis()
{
@@ -157,15 +167,15 @@ QCategoryAxis::QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent): QValueAx
/*!
\qmlmethod CategoryAxis::append(string label, real endValue)
- Appends new category to the axis with an \a label. Category label has to be unique.
- Parameter \a endValue specifies the high end limit of the category.
+ Appends a new category to the axis with the label \a label. A category label has to be unique.
+ \a endValue specifies the high end limit of the category.
It has to be greater than the high end limit of the previous category.
Otherwise the method returns without adding a new category.
*/
/*!
- Appends new category to the axis with an \a categoryLabel.
- Category label has to be unique.
- Parameter \a categoryEndValue specifies the high end limit of the category.
+ Appends a new category to the axis with the label \a categoryLabel.
+ A category label has to be unique.
+ \a categoryEndValue specifies the high end limit of the category.
It has to be greater than the high end limit of the previous category.
Otherwise the method returns without adding a new category.
*/
@@ -190,7 +200,8 @@ void QCategoryAxis::append(const QString &categoryLabel, qreal categoryEndValue)
/*!
Sets \a min to be the low end limit of the first category on the axis.
- If there is already some categories added to the axis then passed value must be lower than the high end value of the already defined first category range.
+ If categories have already been added to the axis, the passed value must be less
+ than the high end value of the already defined first category range.
Otherwise nothing is done.
*/
void QCategoryAxis::setStartValue(qreal min)
@@ -209,7 +220,7 @@ void QCategoryAxis::setStartValue(qreal min)
}
/*!
- Returns the low end limit of the category specified by an \a categoryLabel
+ Returns the low end limit of the category specified by \a categoryLabel.
*/
qreal QCategoryAxis::startValue(const QString &categoryLabel) const
{
@@ -220,7 +231,7 @@ qreal QCategoryAxis::startValue(const QString &categoryLabel) const
}
/*!
- Returns the high end limit of the interval specified by an \a categoryLabel
+ Returns the high end limit of the category specified by \a categoryLabel.
*/
qreal QCategoryAxis::endValue(const QString &categoryLabel) const
{
@@ -230,10 +241,10 @@ qreal QCategoryAxis::endValue(const QString &categoryLabel) const
/*!
\qmlmethod CategoryAxis::remove(string label)
- Removes a category specified by the \a label from the axis
+ Removes a category specified by the label \a label from the axis.
*/
/*!
- Removes an interval specified by the \a categoryLabel from the axis
+ Removes a category specified by the label \a categoryLabel from the axis.
*/
void QCategoryAxis::remove(const QString &categoryLabel)
{
@@ -264,13 +275,13 @@ void QCategoryAxis::remove(const QString &categoryLabel)
}
/*!
- \qmlmethod CategoryAxis::replace(string oldLabel, string newLabel)
- Replaces \a oldLabel of an existing category with a \a newLabel.
- If the old label does not exist the method returns without making any changes.
+ \qmlmethod CategoryAxis::replace(string oldLabel, string newLabel)
+ Replaces an existing category label specified by \a oldLabel with \a newLabel.
+ If the old label does not exist, the method returns without making any changes.
*/
/*!
- Replaces \a oldLabel of an existing category with a \a newLabel
- If the old label does not exist the method returns without making any changes.
+ Replaces an existing category label specified by \a oldLabel with \a newLabel.
+ If the old label does not exist, the method returns without making any changes.
*/
void QCategoryAxis::replaceLabel(const QString &oldLabel, const QString &newLabel)
{
@@ -288,7 +299,7 @@ void QCategoryAxis::replaceLabel(const QString &oldLabel, const QString &newLabe
}
/*!
- Returns the list of the intervals labels
+ Returns the list of the categories' labels.
*/
QStringList QCategoryAxis::categoriesLabels()
{
@@ -297,7 +308,7 @@ QStringList QCategoryAxis::categoriesLabels()
}
/*!
- Returns number of intervals.
+ Returns the number of categories.
*/
int QCategoryAxis::count() const
{
@@ -306,7 +317,7 @@ int QCategoryAxis::count() const
}
/*!
- Returns the type of the axis
+ Returns the type of the axis.
*/
QAbstractAxis::AxisType QCategoryAxis::type() const
{
diff --git a/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp b/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp
index 00c43042..47aa485a 100644
--- a/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp
+++ b/src/charts/axis/datetimeaxis/qdatetimeaxis.cpp
@@ -42,19 +42,19 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QDateTimeAxis
\inmodule Qt Charts
- \brief The QDateTimeAxis class is used for manipulating chart's axis.
+ \brief The QDateTimeAxis class adds dates and times to a chart's axis.
+ QDateTimeAxis can be set up to show an axis line with tick marks, grid lines, and shades.
The labels can be configured by setting an appropriate DateTime format.
QDateTimeAxis works correctly with dates from 4714 BCE to 287396 CE.
- There are also other limitiation related to QDateTime. Please refer to QDateTime documentation.
- QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades.
+ For other limitiations related to QDateTime, see QDateTime documentation.
- Note: QDateTimeAxis is disabled on platforms that define qreal as float.
+ \note QDateTimeAxis is disabled on platforms that define qreal as float.
\image api_datatime_axis.png
QDateTimeAxis can be used with any QXYSeries.
- To add a data point to the series QDateTime::toMSecsSinceEpoch() is used.
+ To add a data point to the series, QDateTime::toMSecsSinceEpoch() is used:
\code
QLineSeries *series = new QLineSeries;
@@ -70,7 +70,8 @@ QT_CHARTS_BEGIN_NAMESPACE
series->append(xValue.toMSecsSinceEpoch(), yValue);
\endcode
- Adding the series to the chart and setting up the QDateTimeAxis.
+ The following code snippet illustrates adding the series to the chart and setting up
+ QDateTimeAxis:
\code
QChartView *chartView = new QChartView;
chartView->chart()->addSeries(series);
@@ -87,102 +88,117 @@ QT_CHARTS_BEGIN_NAMESPACE
\instantiates QDateTimeAxis
\inqmlmodule QtCharts
- \brief The DateTimeAxis element is used for manipulating chart's axes.
+ \brief Adds dates and times to a chart's axis.
\inherits AbstractAxis
- The labels can be configured by setting an appropriate DateTime format.
- Note that any date before 4714 BCE or after about 1.4 million CE may not be accurately stored.
- DateTimeAxis can be setup to show axis line with tick marks, grid lines and shades.
+ The DateTimeAxis type can be set up to show an axis line with tick marks, grid lines,
+ and shades. The axis labels display dates and times and can be configured by setting
+ an appropriate DateTime format.
+
+ \note Any date before 4714 BCE or after about 1.4 million CE may not be accurately stored.
*/
/*!
\property QDateTimeAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
+ \brief The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that the
+ range remains valid.
*/
/*!
\qmlproperty datetime DateTimeAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
+ The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that the
+ range remains valid.
*/
/*!
\property QDateTimeAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
+ \brief The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that the
+ range remains valid.
*/
/*!
\qmlproperty datetime DateTimeAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
+ The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that the
+ range remains valid.
*/
/*!
\fn void QDateTimeAxis::minChanged(QDateTime min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\qmlsignal DateTimeAxis::onMinChanged(datetime min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\fn void QDateTimeAxis::maxChanged(QDateTime max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\qmlsignal DateTimeAxis::onMaxChanged(datetime max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\fn void QDateTimeAxis::rangeChanged(QDateTime min, QDateTime max)
- Axis emits signal when \a min or \a max of axis has changed.
+ This signal is emitted when the minimum or maximum value of the axis, specified by \a min
+ and \a max, changes.
*/
/*!
\property QDateTimeAxis::tickCount
- The number of tick marks for the axis.
+ \brief The number of tick marks on the axis.
*/
/*!
\qmlproperty int DateTimeAxis::tickCount
- The number of tick marks for the axis.
+ The number of tick marks on the axis.
*/
/*!
\property QDateTimeAxis::format
- The format string that is used when creating label for the axis out of a QDateTime object.
- Check QDateTime documentation for information on how the string should be defined.
+ \brief The format string that is used when creating the label for the axis out of a
+ QDateTime object.
+
+ See QDateTime documentation for information on how the string should be defined.
\sa QChart::locale
*/
/*!
\qmlproperty string DateTimeAxis::format
- The format string that is used when creating label for the axis out of a QDateTime object.
- Check QDateTime documentation for information on how the string should be defined.
+ The format string that is used when creating the label for the axis out of a QDateTime object.
+ See QDateTime documentation for information on how the string should be defined.
*/
/*!
\fn void QDateTimeAxis::tickCountChanged(int tickCount)
- Axis emits signal when \a tickCount number on axis have changed.
+ This signal is emitted when the number of tick marks on the axis, specified by \a tickCount,
+ changes.
*/
/*!
\qmlsignal DateTimeAxis::tickCountChanged(int tickCount)
- Axis emits signal when \a tickCount number on axis have changed.
+ This signal is emitted when the number of tick marks on the axis, specified by \a tickCount,
+ changes.
*/
/*!
\fn void QDateTimeAxis::formatChanged(QString format)
- Axis emits signal when \a format of the axis has changed.
+ This signal is emitted when the \a format of the axis changes.
*/
/*!
\qmlsignal DateTimeAxis::onFormatChanged(string format)
- Axis emits signal when \a format of the axis has changed.
+ This signal is emitted when the \a format of the axis changes.
*/
/*!
- Constructs an axis object which is a child of \a parent.
+ Constructs an axis object that is a child of \a parent.
*/
QDateTimeAxis::QDateTimeAxis(QObject *parent) :
QAbstractAxis(*new QDateTimeAxisPrivate(this), parent)
@@ -235,8 +251,8 @@ QDateTime QDateTimeAxis::max() const
}
/*!
- Sets range from \a min to \a max on the axis.
- If min is greater than max then this function returns without making any changes.
+ Sets the range on the axis from \a min to \a max.
+ If \a min is greater than \a max, this function returns without making any changes.
*/
void QDateTimeAxis::setRange(QDateTime min, QDateTime max)
{
@@ -263,7 +279,7 @@ QString QDateTimeAxis::format() const
}
/*!
- Sets \a count for ticks on the axis.
+ Sets the number of tick marks on the axis to \a count.
*/
void QDateTimeAxis::setTickCount(int count)
{
@@ -276,7 +292,7 @@ void QDateTimeAxis::setTickCount(int count)
/*!
\fn int QDateTimeAxis::tickCount() const
- Return number of ticks on the axis.
+ Returns the number of tick marks on the axis.
*/
int QDateTimeAxis::tickCount() const
{
diff --git a/src/charts/axis/logvalueaxis/qlogvalueaxis.cpp b/src/charts/axis/logvalueaxis/qlogvalueaxis.cpp
index 86f86627..3c7a53ac 100644
--- a/src/charts/axis/logvalueaxis/qlogvalueaxis.cpp
+++ b/src/charts/axis/logvalueaxis/qlogvalueaxis.cpp
@@ -41,9 +41,12 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QLogValueAxis
\inmodule Qt Charts
- \brief The QLogValueAxis class is used for manipulating chart's axis.
+ \brief The QLogValueAxis class adds a logarithmic scale to a chart's axis.
- \note If a QLogValueAxis is attached to a series with one or more points with
+ A logarithmic scale is a nonlinear scale that is based on orders of magnitude,
+ so that each tick mark on the axis is the previous tick mark multiplied by a value.
+
+ \note If QLogValueAxis is attached to a series with one or more points with
negative or zero values on the associated dimension, the series will not be
plotted at all. This is particularly relevant when XYModelMappers are used,
since empty cells in models typically contain zero values.
@@ -54,10 +57,13 @@ QT_CHARTS_BEGIN_NAMESPACE
\instantiates QLogValueAxis
\inqmlmodule QtCharts
- \brief The LogValueAxis element is used for manipulating chart's axes.
+ \brief Adds a logarithmic scale to a chart's axis.
\inherits AbstractAxis
- \note If a LogValueAxis is attached to a series with one or more points with
+ A logarithmic scale is a nonlinear scale that is based on orders of magnitude,
+ so that each tick mark on the axis is the previous tick mark multiplied by a value.
+
+ \note If a LogValueAxis type is attached to a series with one or more points with
negative or zero values on the associated dimension, the series will not be
plotted at all. This is particularly relevant when XYModelMappers are used,
since empty cells in models typically contain zero values.
@@ -65,98 +71,122 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QLogValueAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
- Value has to be greater than 0.
+ \brief The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that
+ the range remains valid.
+ The value has to be greater than 0.
*/
/*!
\qmlproperty real LogValueAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
- Value has to be greater than 0.
+ The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that
+ the range remains valid.
+ The value has to be greater than 0.
*/
/*!
\property QLogValueAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
- Value has to be greater than 0.
+ \brief The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that
+ the range remains valid.
+ The value has to be greater than 0.
*/
/*!
\qmlproperty real LogValueAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
- Value has to be greater than 0.
+ The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that
+ the range remains valid.
+ The value has to be greater than 0.
*/
/*!
\property QLogValueAxis::base
- Defines the base of the logarithm.
- Value has to be greater than 0 and not equal 1
+ \brief The base of the logarithm.
+
+ The value has to be greater than 0 and cannot equal 1.
*/
/*!
\qmlproperty real LogValueAxis::base
- Defines the maximum value on the axis.
- Defines the base of the logarithm.
- Value has to be greater than 0 and not equal 1
+ The base of the logarithm.
+
+ The value has to be greater than 0 and cannot equal 1.
*/
/*!
\property QLogValueAxis::labelFormat
- Defines the label format of the axis.
- Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c
- See QString::sprintf() for additional details.
+ \brief The label format of the axis.
+
+ The format string supports the following conversion specifiers, length modifiers, and flags
+ provided by \c printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
+
+ If QChart::localizeNumbers is \c true, the supported specifiers are limited to:
+ d, e, E, f, g, G, and i. Also, only the precision modifier is supported. The rest of the
+ formatting comes from the default QLocale of the application.
+
+ \sa QString::asprintf()
*/
/*!
\qmlproperty real LogValueAxis::labelFormat
- Defines the label format of the axis.
- Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c
- See QString::sprintf() for additional details.
+ The label format of the axis.
+
+ The format string supports the following conversion specifiers, length modifiers, and flags
+ provided by \c printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
+
+ If \l{ChartView::localizeNumbers}{ChartView.localizeNumbers} is \c true, the supported
+ specifiers are limited to: d, e, E, f, g, G, and i. Also, only the precision modifier is
+ supported. The rest of the formatting comes from the default QLocale of the application.
+
+ \sa QString::asprintf()
*/
/*!
\fn void QLogValueAxis::minChanged(qreal min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\qmlsignal LogValueAxis::onMinChanged(qreal min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\fn void QLogValueAxis::maxChanged(qreal max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\qmlsignal LogValueAxis::onMaxChanged(qreal max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\fn void QLogValueAxis::rangeChanged(qreal min, qreal max)
- Axis emits signal when \a min or \a max of axis has changed.
+ This signal is emitted when the minimum or maximum value of the axis, specified by \a min
+ and \a max, changes.
*/
/*!
\fn void QLogValueAxis::labelFormatChanged(const QString &format)
- Axis emits signal when \a format of axis labels has changed.
+ This signal is emitted when the \a format of axis labels changes.
*/
/*!
\qmlsignal LogValueAxis::labelFormatChanged(const QString &format)
- Axis emits signal when \a format of axis labels has changed.
+ This signal is emitted when the \a format of axis labels changes.
*/
/*!
\fn void QLogValueAxis::baseChanged(qreal base)
- Axis emits signal when \a base of logarithm of the axis has changed.
+ This signal is emitted when the \a base of the logarithm of the axis changes.
*/
/*!
\qmlsignal LogValueAxis::baseChanged(qreal base)
- Axis emits signal when \a base of logarithm of the axis has changed.
+ This signal is emitted when the \a base of the logarithm of the axis changes.
*/
/*!
- Constructs an axis object which is a child of \a parent.
+ Constructs an axis object that is a child of \a parent.
*/
QLogValueAxis::QLogValueAxis(QObject *parent) :
QAbstractAxis(*new QLogValueAxisPrivate(this), parent)
@@ -173,7 +203,7 @@ QLogValueAxis::QLogValueAxis(QLogValueAxisPrivate &d, QObject *parent) : QAbstra
}
/*!
- Destroys the object
+ Destroys the object.
*/
QLogValueAxis::~QLogValueAxis()
{
@@ -207,8 +237,8 @@ qreal QLogValueAxis::max() const
}
/*!
- Sets range from \a min to \a max on the axis.
- If min is greater than max then this function returns without making any changes.
+ Sets the range from \a min to \a max on the axis.
+ If \a min is greater than \a max, this function returns without making any changes.
*/
void QLogValueAxis::setRange(qreal min, qreal max)
{
@@ -271,7 +301,7 @@ qreal QLogValueAxis::base() const
}
/*!
- Returns the type of the axis
+ Returns the type of the axis.
*/
QAbstractAxis::AxisType QLogValueAxis::type() const
{
diff --git a/src/charts/axis/qabstractaxis.cpp b/src/charts/axis/qabstractaxis.cpp
index bc1697fe..05f0dc4b 100644
--- a/src/charts/axis/qabstractaxis.cpp
+++ b/src/charts/axis/qabstractaxis.cpp
@@ -38,32 +38,32 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QAbstractAxis
\inmodule Qt Charts
- \brief The QAbstractAxis class is used for manipulating chart's axis.
+ \brief The QAbstractAxis class is a base class used for specialized axis classes.
Each series can be bound to one or more horizontal and vertical axes, but mixing axis types
that would result in different domains is not supported, such as specifying
QValueAxis and QLogValueAxis on the same orientation.
- Properties and visibility of various axis elements such as axis line, title, labels, grid lines,
- and shades can be individually controlled.
+ The properties and visibility of various axis elements, such as axis line, title, labels,
+ grid lines, and shades, can be individually controlled.
*/
/*!
\qmltype AbstractAxis
\instantiates QAbstractAxis
\inqmlmodule QtCharts
- \brief The AbstractAxis is a base element used for specialized axis elements.
+ \brief A base type used for specialized axis types.
Each series can be bound to only one horizontal and vertical axis.
- Properties and visibility of various axis elements such as axis line, title, labels, grid lines,
- and shades can be individually controlled.
+ The properties and visibility of various axis elements, such as axis line, title, labels,
+ grid lines, and shades, can be individually controlled.
*/
/*!
\enum QAbstractAxis::AxisType
- The type of the axis object.
+ This enum type specifies the type of the axis object.
\value AxisTypeNoAxis
\value AxisTypeValue
@@ -74,41 +74,43 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- *\fn void QAbstractAxis::type() const
- Returns the type of the axis
+ \fn void QAbstractAxis::type() const
+ Returns the type of the axis.
*/
/*!
\property QAbstractAxis::lineVisible
- The visibility of the axis line
+ \brief The visibility of the axis line.
*/
/*!
\qmlproperty bool AbstractAxis::lineVisible
- The visibility of the axis line
+ The visibility of the axis line.
*/
/*!
\property QAbstractAxis::linePen
- The pen of the line.
+ \brief The pen used to draw the line.
*/
/*!
\property QAbstractAxis::labelsVisible
- Defines if axis labels are visible.
+ \brief Whether axis labels are visible.
*/
/*!
\qmlproperty bool AbstractAxis::labelsVisible
- Defines if axis labels are visible.
+ The visibility of axis labels.
*/
/*!
\property QAbstractAxis::labelsBrush
- The brush of the labels. Only the color of the brush is relevant.
+ \brief The brush used to draw the labels.
+
+ Only the color of the brush is relevant.
*/
/*!
\property QAbstractAxis::visible
- The visibility of the axis.
+ \brief The visibility of the axis.
*/
/*!
\qmlproperty bool AbstractAxis::visible
@@ -117,7 +119,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::gridVisible
- The visibility of the grid lines.
+ \brief The visibility of the grid lines.
*/
/*!
\qmlproperty bool AbstractAxis::gridVisible
@@ -126,57 +128,63 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::minorGridVisible
- The visibility of the minor grid lines. Applies only to QValueAxis.
+ \brief The visibility of the minor grid lines.
+
+ Applies only to QValueAxis.
*/
/*!
\qmlproperty bool AbstractAxis::minorGridVisible
- The visibility of the minor grid lines. Applies only to QValueAxis.
+ The visibility of the minor grid lines. Applies only to ValueAxis.
*/
/*!
\property QAbstractAxis::color
- The color of the axis and ticks.
+ \brief The color of the axis and tick marks.
*/
/*!
\qmlproperty color AbstractAxis::color
- The color of the axis and ticks.
+ The color of the axis and tick marks.
*/
/*!
\property QAbstractAxis::gridLinePen
- The pen of the grid line.
+ \brief The pen used to draw the grid line.
*/
/*!
\property QAbstractAxis::minorGridLinePen
- The pen of the minor grid line. Applies only to QValueAxis.
+ \brief The pen used to draw the minor grid line.
+
+ Applies only to QValueAxis.
*/
/*!
\property QAbstractAxis::gridLineColor
- The color of the grid line.
+ \brief The color of the grid line.
*/
/*!
\property QAbstractAxis::minorGridLineColor
- The color of the minor grid line. Applies only to QValueAxis.
+ \brief The color of the minor grid line.
+
+ Applies only to QValueAxis.
*/
/*!
\property QAbstractAxis::labelsFont
- The font of the axis labels.
+ \brief The font of the axis labels.
*/
/*!
\qmlproperty Font AbstractAxis::labelsFont
The font of the axis labels.
- See the Qt documentation for more details of Font.
+ For more information, see \l [QML]{font}.
*/
/*!
\property QAbstractAxis::labelsColor
- The color of the axis labels.
+ \brief The color of the axis labels.
*/
/*!
\qmlproperty color AbstractAxis::labelsColor
@@ -185,7 +193,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::labelsAngle
- The angle of the axis labels in degrees.
+ \brief The angle of the axis labels in degrees.
*/
/*!
\qmlproperty int AbstractAxis::labelsAngle
@@ -194,7 +202,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::shadesVisible
- The visibility of the axis shades.
+ \brief The visibility of the axis shades.
*/
/*!
\qmlproperty bool AbstractAxis::shadesVisible
@@ -203,7 +211,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::shadesColor
- The fill (brush) color of the axis shades.
+ \brief The fill (brush) color of the axis shades.
*/
/*!
\qmlproperty color AbstractAxis::shadesColor
@@ -212,7 +220,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::shadesBorderColor
- The border (pen) color of the axis shades.
+ \brief The border (pen) color of the axis shades.
*/
/*!
\qmlproperty color AbstractAxis::shadesBorderColor
@@ -221,40 +229,46 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::shadesPen
- The pen of the axis shades (area between grid lines).
+ \brief The pen used to draw the axis shades (the area between the grid lines).
*/
/*!
\property QAbstractAxis::shadesBrush
- The brush of the axis shades (area between grid lines).
+ \brief The brush used to draw the axis shades (the area between the grid lines).
*/
/*!
\property QAbstractAxis::titleVisible
- The visibility of the axis title. By default the value is true.
+ \brief The visibility of the axis title.
+
+ By default, the value is \c true.
*/
/*!
\qmlproperty bool AbstractAxis::titleVisible
- The visibility of the axis title. By default the value is true.
+ The visibility of the axis title. By default, the value is \c true.
*/
/*!
\property QAbstractAxis::titleText
- The title of the axis. Empty by default. Axis titles support html formatting.
+ \brief The title of the axis.
+
+ Empty by default. Axis titles support HTML formatting.
*/
/*!
\qmlproperty String AbstractAxis::titleText
- The title of the axis. Empty by default. Axis titles support html formatting.
+ The title of the axis. Empty by default. Axis titles support HTML formatting.
*/
/*!
\property QAbstractAxis::titleBrush
- The brush of the title text. Only the color of the brush is relevant.
+ \brief The brush used to draw the title text.
+
+ Only the color of the brush is relevant.
*/
/*!
\property QAbstractAxis::titleFont
- The font of the title of the axis.
+ \brief The font of the title of the axis.
*/
/*!
\qmlproperty Font AbstractAxis::titleFont
@@ -263,223 +277,235 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractAxis::orientation
- The orientation of the axis. Fixed to either Qt::Horizontal or Qt::Vertical when you add the axis to a chart.
+ \brief The orientation of the axis.
+
+ Fixed to either Qt::Horizontal or Qt::Vertical when the axis is added to a chart.
*/
/*!
\qmlproperty Qt.Orientation AbstractAxis::orientation
- The orientation of the axis. Fixed to either Qt.Horizontal or Qt.Vertical when the axis is set to a series.
+ The orientation of the axis. Fixed to either \l {Qt::Horizontal}{Qt.Horizontal}
+ or \l{Qt::Vertical}{Qt.Vertical} when the axis is set to a series.
*/
/*!
\property QAbstractAxis::alignment
- The alignment of the axis. Can be Qt::AlignLeft, Qt::AlignRight, Qt::AlignBottom, or Qt::AlignTop.
+ \brief The alignment of the axis.
+
+ Can be Qt::AlignLeft, Qt::AlignRight, Qt::AlignBottom, or Qt::AlignTop.
*/
/*!
\qmlproperty alignment AbstractAxis::alignment
- The alignment of the axis. Can be Qt.AlignLeft, Qt.AlignRight, Qt.AlignBottom, or Qt.AlignTop.
+ The alignment of the axis. Can be \l{Qt::AlignLeft}{Qt.AlignLeft},
+ \l{Qt::AlignRight}{Qt.AlignRight}, \l{Qt::AlignBottom}{Qt.AlignBottom}, or
+ \l{Qt::AlignTop}{Qt.AlignTop}.
*/
/*!
\property QAbstractAxis::reverse
- The reverse property defines if reverse axis is used. By default the value is false.
+ \brief Whether a reverse axis is used.
+
+ By default, the value is \c false.
- Reverse axis is supported with line, spline, scatter and area series with cartesian chart.
- All axes of the same orientation attached to same series must be reversed if one is reversed or
- the behavior is undefined.
+ The reverse axis is supported with a line, spline, and scatter series, as well as an area series
+ with a cartesian chart. All axes of the same orientation attached to the same series must be
+ reversed if one is reversed or the behavior is undefined.
*/
/*!
\qmlproperty alignment AbstractAxis::reverse
- The reverse property defines if reverse axis is used. By default the value is false.
+ Defines whether a reverse axis is used. By default, the value is \c false.
- Reverse axis is supported with line, spline, scatter and area series with cartesian chart.
- All axes of the same orientation attached to same series must be reversed if one is reversed or
- the behavior is undefined.
+ The reverse axis is supported with a line, spline, and scatter series, as well as an area series
+ with a cartesian chart. All axes of the same orientation attached to the same series must be
+ reversed if one is reversed or the behavior is undefined.
*/
/*!
\fn void QAbstractAxis::visibleChanged(bool visible)
- Visibility of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the axis changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onVisibleChanged(bool visible)
- Visibility of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the axis changes to \a visible.
*/
/*!
\fn void QAbstractAxis::linePenChanged(const QPen& pen)
- The pen of the line of the axis has changed to \a pen.
+ This signal is emitted when the pen used to draw the line of the axis changes to \a pen.
*/
/*!
\fn void QAbstractAxis::lineVisibleChanged(bool visible)
- Visibility of the axis line has changed to \a visible.
+ This signal is emitted when the visibility of the axis line changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onLineVisibleChanged(bool visible)
- Visibility of the axis line has changed to \a visible.
+ This signal is emitted when the visibility of the axis line changes to \a visible.
*/
/*!
\fn void QAbstractAxis::labelsVisibleChanged(bool visible)
- Visibility of the labels of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the labels of the axis changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onLabelsVisibleChanged(bool visible)
- Visibility of the labels of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the labels of the axis changes to \a visible.
*/
/*!
\fn void QAbstractAxis::labelsFontChanged(const QFont& font)
- The font of the axis labels has changed to \a font.
+ This signal is emitted when the font of the axis labels changes to \a font.
*/
/*!
\qmlsignal AbstractAxis::onLabelsFontChanged(Font font)
- The font of the axis labels has changed to \a font.
+ This signal is emitted when the font of the axis labels changes to \a font.
*/
/*!
\fn void QAbstractAxis::labelsBrushChanged(const QBrush& brush)
- The brush of the axis labels has changed to \a brush.
+ This signal is emitted when the brush used to draw the axis labels changes to \a brush.
*/
/*!
\fn void QAbstractAxis::labelsAngleChanged(int angle)
- The angle of the axis labels has changed to \a angle.
+ This signal is emitted when the angle of the axis labels changes to \a angle.
*/
/*!
\qmlsignal AbstractAxis::onLabelsAngleChanged(int angle)
- The angle of the axis labels has changed to \a angle.
+ This signal is emitted when the angle of the axis labels changes to \a angle.
*/
/*!
\fn void QAbstractAxis::gridVisibleChanged(bool visible)
- Visibility of the grid lines of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the grid lines of the axis changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onGridVisibleChanged(bool visible)
- Visibility of the grid lines of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the grid lines of the axis changes to \a visible.
*/
/*!
\fn void QAbstractAxis::minorGridVisibleChanged(bool visible)
- Visibility of the minor grid lines of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the minor grid lines of the axis
+ changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onMinorGridVisibleChanged(bool visible)
- Visibility of the minor grid lines of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the minor grid lines of the axis
+ changes to \a visible.
*/
/*!
\fn void QAbstractAxis::gridLinePenChanged(const QPen& pen)
- The pen of the grid line has changed to \a pen.
+ This signal is emitted when the pen used to draw the grid line changes to \a pen.
*/
/*!
\fn void QAbstractAxis::minorGridLinePenChanged(const QPen& pen)
- The pen of the minor grid line has changed to \a pen.
+ This signal is emitted when the pen used to draw the minor grid line changes to \a pen.
*/
/*!
\fn void QAbstractAxis::gridLineColorChanged(const QColor &color)
- The color of the pen of the grid line has changed to \a color.
+ This signal is emitted when the color of the pen used to draw the grid line changes to \a color.
*/
/*!
\fn void QAbstractAxis::minorGridLineColorChanged(const QColor &color)
- The color of the pen of the minor grid line has changed to \a color.
+ This signal is emitted when the color of the pen used to draw the minor grid line changes
+ to \a color.
*/
/*!
\fn void QAbstractAxis::colorChanged(QColor color)
- Emitted if the \a color of the axis is changed.
+ This signal is emitted when the color of the axis changes to \a color.
*/
/*!
\qmlsignal AbstractAxis::onColorChanged(QColor color)
- Emitted if the \a color of the axis is changed.
+ This signal is emitted when the color of the axis changes to \a color.
*/
/*!
\fn void QAbstractAxis::labelsColorChanged(QColor color)
- Emitted if the \a color of the axis labels is changed.
+ This signal is emitted when the color of the axis labels changes to \a color.
*/
/*!
\qmlsignal AbstractAxis::onLabelsColorChanged(QColor color)
- Emitted if the \a color of the axis labels is changed.
+ This signal is emitted when the color of the axis labels changes to \a color.
*/
/*!
\fn void QAbstractAxis::titleVisibleChanged(bool visible)
- Visibility of the title text of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the title text of the axis changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onTitleVisibleChanged(bool visible)
- Visibility of the title text of the axis has changed to \a visible.
+ This signal is emitted when the visibility of the title text of the axis changes to \a visible.
*/
/*!
\fn void QAbstractAxis::titleTextChanged(const QString& text)
- The text of the axis title has changed to \a text.
+ This signal is emitted when the text of the axis title changes to \a text.
*/
/*!
\qmlsignal AbstractAxis::onTitleTextChanged(String text)
- The text of the axis title has changed to \a text.
+ This signal is emitted when the text of the axis title changes to \a text.
*/
/*!
\fn void QAbstractAxis::titleBrushChanged(const QBrush& brush)
- The brush of the axis title has changed to \a brush.
+ This signal is emitted when the brush used to draw the axis title changes to \a brush.
*/
/*!
\fn void QAbstractAxis::titleFontChanged(const QFont& font)
- The font of the axis title has changed to \a font.
+ This signal is emitted when the font of the axis title changes to \a font.
*/
/*!
\qmlsignal AbstractAxis::onTitleFontChanged(Font font)
- The font of the axis title has changed to \a font.
+ This signal is emitted when the font of the axis title changes to \a font.
*/
/*!
\fn void QAbstractAxis::shadesVisibleChanged(bool)
- Emitted if the visibility of the axis shades is changed to \a visible.
+ This signal is emitted when the visibility of the axis shades changes to \a visible.
*/
/*!
\qmlsignal AbstractAxis::onShadesVisibleChanged(bool visible)
- Emitted if the visibility of the axis shades is changed to \a visible.
+ This signal is emitted when the visibility of the axis shades changes to \a visible.
*/
/*!
\fn void QAbstractAxis::shadesColorChanged(QColor color)
- Emitted if the \a color of the axis shades is changed.
+ This signal is emitted when the color of the axis shades changes to \a color.
*/
/*!
\qmlsignal AbstractAxis::onShadesColorChanged(QColor color)
- Emitted if the \a color of the axis shades is changed.
+ This signal is emitted when the color of the axis shades changes to \a color.
*/
/*!
- \fn void QAbstractAxis::shadesBorderColorChanged(QColor)
- Emitted if the border \a color of the axis shades is changed.
+ \fn void QAbstractAxis::shadesBorderColorChanged(QColor color)
+ This signal is emitted when the border color of the axis shades changes to \a color.
*/
/*!
\qmlsignal AbstractAxis::onBorderColorChanged(QColor color)
- Emitted if the border \a color of the axis shades is changed.
+ This signal is emitted when the border color of the axis shades changes to \a color.
*/
/*!
\fn void QAbstractAxis::shadesBrushChanged(const QBrush& brush)
- The brush of the axis shades has changed to \a brush.
+ This signal is emitted when the brush used to draw the axis shades changes to \a brush.
*/
/*!
\fn void QAbstractAxis::shadesPenChanged(const QPen& pen)
- The pen of the axis shades has changed to \a pen.
+ This signal is emitted when the pen used to draw the axis shades changes to \a pen.
*/
/*!
\internal
- Constructs new axis object which is a child of \a parent. Ownership is taken by
- QChart when axis added.
+ Constructs a new axis object that is a child of \a parent. The ownership is taken by
+ QChart when the axis is added.
*/
QAbstractAxis::QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent)
@@ -489,7 +515,7 @@ QAbstractAxis::QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent)
}
/*!
- Destructor of the axis object. When axis is added to chart, chart object takes ownership.
+ Destructs the axis object. When the axis is added to a chart, the chart object takes ownership.
*/
QAbstractAxis::~QAbstractAxis()
@@ -499,7 +525,7 @@ QAbstractAxis::~QAbstractAxis()
}
/*!
- Sets \a pen used to draw axis line and ticks.
+ Sets the pen used to draw the axis line and tick marks to \a pen.
*/
void QAbstractAxis::setLinePen(const QPen &pen)
{
@@ -510,7 +536,7 @@ void QAbstractAxis::setLinePen(const QPen &pen)
}
/*!
- Returns pen used to draw axis and ticks.
+ Returns the pen used to draw the axis line and tick marks.
*/
QPen QAbstractAxis::linePen() const
{
@@ -536,7 +562,7 @@ QColor QAbstractAxis::linePenColor() const
}
/*!
- Sets if axis and ticks are \a visible.
+ Determines whether the axis line and tick marks are \a visible.
*/
void QAbstractAxis::setLineVisible(bool visible)
{
@@ -578,7 +604,7 @@ bool QAbstractAxis::isMinorGridLineVisible() const
}
/*!
- Sets \a pen used to draw grid line.
+ Sets the pen used to draw the grid lines to \a pen.
*/
void QAbstractAxis::setGridLinePen(const QPen &pen)
{
@@ -589,7 +615,7 @@ void QAbstractAxis::setGridLinePen(const QPen &pen)
}
/*!
- Returns pen used to draw grid.
+ Returns the pen used to draw the grid.
*/
QPen QAbstractAxis::gridLinePen() const
{
@@ -659,7 +685,7 @@ bool QAbstractAxis::labelsVisible() const
}
/*!
- Sets \a brush used to draw labels.
+ Sets the brush used to draw labels to \a brush.
*/
void QAbstractAxis::setLabelsBrush(const QBrush &brush)
{
@@ -670,7 +696,7 @@ void QAbstractAxis::setLabelsBrush(const QBrush &brush)
}
/*!
- Returns brush used to draw labels.
+ Returns the brush used to draw labels.
*/
QBrush QAbstractAxis::labelsBrush() const
{
@@ -681,7 +707,7 @@ QBrush QAbstractAxis::labelsBrush() const
}
/*!
- Sets \a font used to draw labels.
+ Sets the font used to draw labels to \a font.
*/
void QAbstractAxis::setLabelsFont(const QFont &font)
{
@@ -692,7 +718,7 @@ void QAbstractAxis::setLabelsFont(const QFont &font)
}
/*!
- Returns font used to draw labels.
+ Returns the font used to draw labels.
*/
QFont QAbstractAxis::labelsFont() const
{
@@ -743,7 +769,7 @@ bool QAbstractAxis::isTitleVisible() const
}
/*!
- Sets \a brush used to draw title.
+ Sets the brush used to draw titles to \a brush.
*/
void QAbstractAxis::setTitleBrush(const QBrush &brush)
{
@@ -754,7 +780,7 @@ void QAbstractAxis::setTitleBrush(const QBrush &brush)
}
/*!
- Returns brush used to draw title.
+ Returns the brush used to draw titles.
*/
QBrush QAbstractAxis::titleBrush() const
{
@@ -765,7 +791,7 @@ QBrush QAbstractAxis::titleBrush() const
}
/*!
- Sets \a font used to draw title.
+ Sets the font used to draw titles to \a font.
*/
void QAbstractAxis::setTitleFont(const QFont &font)
{
@@ -776,7 +802,7 @@ void QAbstractAxis::setTitleFont(const QFont &font)
}
/*!
- Returns font used to draw title.
+ Returns the font used to draw titles.
*/
QFont QAbstractAxis::titleFont() const
{
@@ -814,7 +840,7 @@ bool QAbstractAxis::shadesVisible() const
}
/*!
- Sets \a pen used to draw shades.
+ Sets the pen used to draw shades to \a pen.
*/
void QAbstractAxis::setShadesPen(const QPen &pen)
{
@@ -825,7 +851,7 @@ void QAbstractAxis::setShadesPen(const QPen &pen)
}
/*!
- Returns pen used to draw shades.
+ Returns the pen used to draw shades.
*/
QPen QAbstractAxis::shadesPen() const
{
@@ -836,7 +862,7 @@ QPen QAbstractAxis::shadesPen() const
}
/*!
- Sets \a brush used to draw shades.
+ Sets the brush used to draw shades to \a brush.
*/
void QAbstractAxis::setShadesBrush(const QBrush &brush)
{
@@ -847,7 +873,7 @@ void QAbstractAxis::setShadesBrush(const QBrush &brush)
}
/*!
- Returns brush used to draw shades.
+ Returns the brush used to draw shades.
*/
QBrush QAbstractAxis::shadesBrush() const
{
@@ -894,7 +920,7 @@ bool QAbstractAxis::isVisible() const
}
/*!
- Sets axis, shades, labels and grid lines visibility to \a visible.
+ Sets the visibility of the axis, shades, labels, and grid lines to \a visible.
*/
void QAbstractAxis::setVisible(bool visible)
{
@@ -906,7 +932,7 @@ void QAbstractAxis::setVisible(bool visible)
/*!
- Sets axis, shades, labels and grid lines to be visible.
+ Makes the axis, shades, labels, and grid lines visible.
*/
void QAbstractAxis::show()
{
@@ -914,7 +940,7 @@ void QAbstractAxis::show()
}
/*!
- Sets axis, shades, labels and grid lines to not be visible.
+ Makes the axis, shades, labels, and grid lines invisible.
*/
void QAbstractAxis::hide()
{
@@ -923,8 +949,8 @@ void QAbstractAxis::hide()
/*!
Sets the minimum value shown on the axis.
- Depending on the actual axis type the \a min parameter is converted to appropriate type.
- If the conversion is impossible then the function call does nothing
+ Depending on the actual axis type, the \a min parameter is converted to the appropriate type
+ of value. If the conversion is impossible, the function call does nothing.
*/
void QAbstractAxis::setMin(const QVariant &min)
{
@@ -933,8 +959,8 @@ void QAbstractAxis::setMin(const QVariant &min)
/*!
Sets the maximum value shown on the axis.
- Depending on the actual axis type the \a max parameter is converted to appropriate type.
- If the conversion is impossible then the function call does nothing
+ Depending on the actual axis type, the \a max parameter is converted to the appropriate type
+ of value. If the conversion is impossible, the function call does nothing.
*/
void QAbstractAxis::setMax(const QVariant &max)
{
@@ -943,8 +969,8 @@ void QAbstractAxis::setMax(const QVariant &max)
/*!
Sets the range shown on the axis.
- Depending on the actual axis type the \a min and \a max parameters are converted to appropriate types.
- If the conversion is impossible then the function call does nothing.
+ Depending on the actual axis type, the \a min and \a max parameters are converted to
+ appropriate types of values. If the conversion is impossible, the function call does nothing.
*/
void QAbstractAxis::setRange(const QVariant &min, const QVariant &max)
{
@@ -953,7 +979,7 @@ void QAbstractAxis::setRange(const QVariant &min, const QVariant &max)
/*!
- Returns the orientation in which the axis is being used (Vertical or Horizontal)
+ Returns the orientation of the axis (vertical or horizontal).
*/
Qt::Orientation QAbstractAxis::orientation() const
{
diff --git a/src/charts/axis/valueaxis/qvalueaxis.cpp b/src/charts/axis/valueaxis/qvalueaxis.cpp
index bf7e9ba1..d650d3ba 100644
--- a/src/charts/axis/valueaxis/qvalueaxis.cpp
+++ b/src/charts/axis/valueaxis/qvalueaxis.cpp
@@ -43,12 +43,12 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QValueAxis
\inmodule Qt Charts
- \brief The QValueAxis class is used for manipulating chart's axis.
+ \brief The QValueAxis class adds values to a chart's axes.
- ValueAxis can be setup to show axis line with tick marks, grid lines and shades.
- Values of axis are drawn to position of ticks.
+ A value axis can be set up to show an axis line with tick marks, grid lines, and shades.
+ The values on the axis are drawn at the positions of tick marks.
- Example code on how to use QValueAxis.
+ The following example code illustrates how to use the QValueAxis class:
\code
QChartView *chartView = new QChartView;
QLineSeries *series = new QLineSeries;
@@ -68,12 +68,12 @@ QT_CHARTS_BEGIN_NAMESPACE
\inqmlmodule QtCharts
\inherits AbstractAxis
- \brief The ValueAxis element is used for manipulating chart's axes
+ \brief Adds values to a chart's axes.
- ValueAxis can be setup to show axis line with tick marks, grid lines and shades.
- Values of axis are drawn to position of ticks
+ The ValueAxis type can be set up to show an axis line with tick marks, grid lines, and shades.
+ The values on the axis are drawn at the positions of tick marks.
- Example about using ValueAxis:
+ The following example code illustrates how to use the ValueAxis type:
\code
ChartView {
ValueAxis {
@@ -88,121 +88,139 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QValueAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
+ \brief The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that
+ the range remains valid.
*/
/*!
\qmlproperty real ValueAxis::min
- Defines the minimum value on the axis.
- When setting this property the max is adjusted if necessary, to ensure that the range remains valid.
+ The minimum value on the axis.
+
+ When setting this property, the maximum value is adjusted if necessary, to ensure that
+ the range remains valid.
*/
/*!
\property QValueAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
+ \brief The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that
+ the range remains valid.
*/
/*!
\qmlproperty real ValueAxis::max
- Defines the maximum value on the axis.
- When setting this property the min is adjusted if necessary, to ensure that the range remains valid.
+ The maximum value on the axis.
+
+ When setting this property, the minimum value is adjusted if necessary, to ensure that
+ the range remains valid.
*/
/*!
\property QValueAxis::tickCount
- Defines the number of ticks on the axis. This indicates how many grid lines are drawn on the
- chart. The default value is 5, and it can not be below 2.
+ \brief The number of tick marks on the axis. This indicates how many grid lines are drawn on the
+ chart. The default value is 5, and the number cannot be less than 2.
*/
/*!
\qmlproperty int ValueAxis::tickCount
- Defines the number of ticks on the axis. This indicates how many grid lines are drawn on the
- chart. The default value is 5, and it can not be below 2.
+ The number of tick marks on the axis. This indicates how many grid lines are drawn on the
+ chart. The default value is 5, and the number cannot be less than 2.
*/
/*!
\property QValueAxis::minorTickCount
- Defines the number of minor ticks on the axis. This indicates how many grid lines are drawn
+ \brief The number of minor tick marks on the axis. This indicates how many grid lines are drawn
between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0.
*/
/*!
\qmlproperty int ValueAxis::minorTickCount
- Defines the number of minor ticks on the axis. This indicates how many grid lines are drawn
+ The number of minor tick marks on the axis. This indicates how many grid lines are drawn
between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0.
*/
/*!
\property QValueAxis::labelFormat
- Defines the label format of the axis.
- Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, and c.
- See QString::sprintf() for additional details.
+ \brief The label format of the axis.
+
+ The format string supports the following conversion specifiers, length modifiers, and flags
+ provided by \c printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
- If the QChart::localizeNumbers is \c{true}, the supported specifiers are limited to: d, e, E, f,
- g, G, and i. Also, only the precision modifier is supported. The rest of the formatting comes from
- the default QLocale of the application.
+ If QChart::localizeNumbers is \c true, the supported specifiers are limited to:
+ d, e, E, f, g, G, and i. Also, only the precision modifier is supported. The rest of the
+ formatting comes from the default QLocale of the application.
+
+ \sa QString::asprintf()
*/
/*!
\qmlproperty real ValueAxis::labelFormat
- Defines the label format of the axis.
- Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, and c.
- See QString::sprintf() for additional details.
- If the ChartView::localizeNumbers is \c{true}, the supported specifiers are limited to: d, e, E, f,
- g, G, and i. Also, only the precision modifier is supported. The rest of the formatting comes from
- the default QLocale of the application.
+ The format string supports the following conversion specifiers, length modifiers, and flags
+ provided by \c printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
+
+ If \l{ChartView::localizeNumbers}{ChartView.localizeNumbers} is \c true, the supported
+ specifiers are limited to: d, e, E, f, g, G, and i. Also, only the precision modifier is
+ supported. The rest of the formatting comes from the default QLocale of the application.
+
+ \sa QString::asprintf()
*/
/*!
\fn void QValueAxis::minChanged(qreal min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\qmlsignal ValueAxis::onMinChanged(real min)
- Axis emits signal when \a min of axis has changed.
+ This signal is emitted when the minimum value of the axis, specified by \a min, changes.
*/
/*!
\fn void QValueAxis::maxChanged(qreal max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\qmlsignal ValueAxis::onMaxChanged(real max)
- Axis emits signal when \a max of axis has changed.
+ This signal is emitted when the maximum value of the axis, specified by \a max, changes.
*/
/*!
\fn void QValueAxis::tickCountChanged(int tickCount)
- Axis emits signal when \a tickCount of axis has changed.
+ This signal is emitted when the number of tick marks on the axis, specified by \a tickCount,
+ changes.
*/
/*!
\qmlsignal ValueAxis::tickCountChanged(int tickCount)
- Axis emits signal when \a tickCount of axis has changed.
+ This signal is emitted when the number of tick marks on the axis, specified by \a tickCount,
+ changes.
*/
/*!
\fn void QValueAxis::minorTickCountChanged(int minorTickCount)
- Axis emits signal when \a minorTickCount of axis has changed.
+ This signal is emitted when the number of minor tick marks on the axis, specified by
+ \a minorTickCount, changes.
*/
/*!
\qmlsignal ValueAxis::minorTickCountChanged(int minorTickCount)
- Axis emits signal when \a minorTickCount of axis has changed.
+ This signal is emitted when the number of minor tick marks on the axis, specified by
+ \a minorTickCount, changes.
*/
/*!
\fn void QValueAxis::rangeChanged(qreal min, qreal max)
- Axis emits signal when \a min or \a max of axis has changed.
+ This signal is emitted when the minimum or maximum value of the axis, specified by \a min
+ and \a max, changes.
*/
/*!
\fn void QValueAxis::labelFormatChanged(const QString &format)
- Axis emits signal when \a format of axis labels has changed.
+ This signal is emitted when the \a format of axis labels changes.
*/
/*!
\qmlsignal ValueAxis::labelFormatChanged(const QString &format)
- Axis emits signal when \a format of axis labels has changed.
+ This signal is emitted when the \a format of axis labels changes.
*/
/*!
- Constructs an axis object which is a child of \a parent.
+ Constructs an axis object that is a child of \a parent.
*/
QValueAxis::QValueAxis(QObject *parent) :
QAbstractAxis(*new QValueAxisPrivate(this), parent)
@@ -220,7 +238,7 @@ QValueAxis::QValueAxis(QValueAxisPrivate &d, QObject *parent)
}
/*!
- Destroys the object
+ Destroys the object.
*/
QValueAxis::~QValueAxis()
{
@@ -254,8 +272,8 @@ qreal QValueAxis::max() const
}
/*!
- Sets range from \a min to \a max on the axis.
- If min is greater than max then this function returns without making any changes.
+ Sets the range from \a min to \a max on the axis.
+ If \a min is greater than \a max, this function returns without making any changes.
*/
void QValueAxis::setRange(qreal min, qreal max)
{
@@ -307,7 +325,7 @@ QString QValueAxis::labelFormat() const
}
/*!
- Returns the type of the axis
+ Returns the type of the axis.
*/
QAbstractAxis::AxisType QValueAxis::type() const
{
@@ -315,9 +333,10 @@ QAbstractAxis::AxisType QValueAxis::type() const
}
/*!
- This method modifies range and number of ticks on the axis to look "nice". Algorithm considers numbers that
- can be expressed as form of 1*10^n, 2* 10^n or 5*10^n as a nice numbers. These numbers are used for spacing the ticks.
- This method will modify the current range and number of ticks.
+ Modifies the current range and number of tick marks on the axis to look \e nice. The algorithm
+ considers numbers that can be expressed as a form of 1*10^n, 2* 10^n, or 5*10^n to be
+ nice numbers. These numbers are used for setting spacing for the tick marks.
+
\sa setRange(), setTickCount()
*/
void QValueAxis::applyNiceNumbers()
diff --git a/src/charts/barchart/horizontal/bar/qhorizontalbarseries.cpp b/src/charts/barchart/horizontal/bar/qhorizontalbarseries.cpp
index d739bf4d..7b3aa35d 100644
--- a/src/charts/barchart/horizontal/bar/qhorizontalbarseries.cpp
+++ b/src/charts/barchart/horizontal/bar/qhorizontalbarseries.cpp
@@ -41,11 +41,11 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QHorizontalBarSeries
\inmodule Qt Charts
- \brief Series for creating horizontal bar chart.
+ \brief The QHorizontalBarSeries class presents a series of data as horizontal bars grouped by
+ category.
- QHorizontalBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as groups, where bars in same category are grouped next to each other. QHorizontalBarSeries groups the data
- from sets to categories, which are defined by a QStringList.
+ This class draws data as a series of horizontal bars grouped by category, with one bar per
+ category from each bar set added to the series.
See the \l {HorizontalBarChart Example} {horizontal bar chart example} to learn how to create a horizontal bar chart.
\image examples_horizontalbarchart.png
@@ -59,9 +59,12 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series type for creating horizontal bar chart.
+ \brief Presents a series of data as horizontal bars grouped by category.
- The following QML shows how to create a simple horizontal bar chart:
+ The data is drawn as a series of horizontal bars grouped by category, with one bar per
+ category from each bar set added to the series.
+
+ The following QML code snippet shows how to create a simple horizontal bar chart:
\snippet qmlchart/qml/qmlchart/View9.qml 1
\beginfloatleft
\image examples_qmlchart9.png
@@ -70,8 +73,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QHorizontalBarSeries.
- QHorizontalBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty horizontal bar series that is a QObject and a child of \a parent.
*/
QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent)
: QAbstractBarSeries(*new QHorizontalBarSeriesPrivate(this), parent)
@@ -79,8 +81,7 @@ QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent)
}
/*!
- Destructor.
- Removes series from chart.
+ Removes the horizontal bar series from the chart.
*/
QHorizontalBarSeries::~QHorizontalBarSeries()
{
@@ -90,7 +91,7 @@ QHorizontalBarSeries::~QHorizontalBarSeries()
}
/*!
- Returns QChartSeries::SeriesTypeHorizontalBar.
+ Returns the horizontal bar series.
*/
QAbstractSeries::SeriesType QHorizontalBarSeries::type() const
{
diff --git a/src/charts/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp b/src/charts/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp
index 7a6e04de..5c1da062 100644
--- a/src/charts/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp
+++ b/src/charts/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp
@@ -38,12 +38,14 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QHorizontalPercentBarSeries
\inmodule Qt Charts
- \brief Series for creating horizontal percent bar chart.
+ \brief The QHorizontalPercentBarSeries class presents a series of categorized data as
+ a percentage of each category.
- QHorizontalPercentBarSeries represents a series of data shown as bars. The purpose of this
- class is to draw bars as groups, where bars in same category are grouped next to each other.
- QHorizontalPercentBarSeries groups the data from sets to categories, which are defined by a
- QStringList. Bars with zero value are not drawn.
+ This class draws data as a series of uniformly sized horizontally stacked bars, with one
+ bar per category. Each bar set added to the series contributes a single segment to each
+ stacked bar. The segment size corresponds to the percentage of the segment value compared
+ with the total value of all segments in the stack.
+ Bars with zero value are not drawn.
See the \l {HorizontalPercentBarChart Example} {horizontal percent bar chart example} to learn
how to create a horizontal percent bar chart.
@@ -59,9 +61,15 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series type for creating horizontal precent bar chart.
+ \brief Presents a series of categorized data as a percentage of each category.
- The following QML shows how to create a simple horizontal percent bar chart:
+ The data is drawn as a series of uniformly sized horizontally stacked bars, with one
+ bar per category. Each bar set added to the series contributes a single segment to each
+ stacked bar. The segment size corresponds to the percentage of the segment value compared
+ with the total value of all segments in the stack.
+ Bars with zero value are not drawn.
+
+ The following QML code snippet shows how to create a simple horizontal percent bar chart:
\snippet qmlchart/qml/qmlchart/View11.qml 1
\beginfloatleft
\image examples_qmlchart11.png
@@ -70,8 +78,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QHorizontalPercentBarSeries.
- QHorizontalPercentBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty horizontal percent bar series that is a QObject and a child of \a parent.
*/
QHorizontalPercentBarSeries::QHorizontalPercentBarSeries(QObject *parent) :
QAbstractBarSeries(*new QHorizontalPercentBarSeriesPrivate(this), parent)
@@ -79,7 +86,7 @@ QHorizontalPercentBarSeries::QHorizontalPercentBarSeries(QObject *parent) :
}
/*!
- Returns QAbstractSeries::SeriesTypeHorizontalPercentBar.
+ Returns the horizontal percent bar series.
*/
QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const
{
@@ -87,8 +94,8 @@ QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const
}
/*!
- Destructor.
- Removes series from chart.
+ Removes the bar series from the chart.
+
*/
QHorizontalPercentBarSeries::~QHorizontalPercentBarSeries()
{
diff --git a/src/charts/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp b/src/charts/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp
index 946311ca..f7530ce5 100644
--- a/src/charts/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp
+++ b/src/charts/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp
@@ -37,11 +37,10 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QHorizontalStackedBarSeries
\inmodule Qt Charts
- \brief Series for creating horizontal stacked bar chart.
+ \brief The QHorizontalStackedBarSeries class presents a series of data as horizontally
+ stacked bars, with one bar per category.
- QHorizontalStackedBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as groups, where bars in same category are grouped next to each other. QHorizontalStackedBarSeries groups the data
- from sets to categories, which are defined by a QStringList.
+ Each bar set added to the series contributes a single segment to each stacked bar.
See the \l {HorizontalStackedBarChart Example} {horizontal stacked bar chart example} to learn how to create a horizontal stacked bar chart.
\image examples_horizontalstackedbarchart.png
@@ -55,9 +54,11 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series type for creating horizontal stacked bar chart.
+ \brief Presents a series of data as stacked horizontal bars, with one bar per category.
- The following QML shows how to create a simple horizontal stacked bar chart:
+ Each bar set added to the series contributes a single segment to each stacked bar.
+
+ The following QML code snippet shows how to create a simple horizontal stacked bar chart:
\snippet qmlchart/qml/qmlchart/View10.qml 1
\beginfloatleft
\image examples_qmlchart10.png
@@ -66,8 +67,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QHorizontalStackedBarSeries.
- QHorizontalStackedBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty horizontal stacked bar series that is a QObject and a child of \a parent.
*/
QHorizontalStackedBarSeries::QHorizontalStackedBarSeries(QObject *parent)
: QAbstractBarSeries(*new QHorizontalStackedBarSeriesPrivate(this), parent)
@@ -75,8 +75,7 @@ QHorizontalStackedBarSeries::QHorizontalStackedBarSeries(QObject *parent)
}
/*!
- Destructor.
- Removes series from chart.
+ Removes the bar series from the chart.
*/
QHorizontalStackedBarSeries::~QHorizontalStackedBarSeries()
{
@@ -86,7 +85,7 @@ QHorizontalStackedBarSeries::~QHorizontalStackedBarSeries()
}
/*!
- Returns QAbstractSeries::SeriesTypeHorizontalStackedBar.
+ Returns the horizontal stacked bar series.
*/
QAbstractSeries::SeriesType QHorizontalStackedBarSeries::type() const
{
diff --git a/src/charts/barchart/qabstractbarseries.cpp b/src/charts/barchart/qabstractbarseries.cpp
index be62a0d3..b2a2a7bc 100644
--- a/src/charts/barchart/qabstractbarseries.cpp
+++ b/src/charts/barchart/qabstractbarseries.cpp
@@ -46,17 +46,23 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QAbstractBarSeries
\inmodule Qt Charts
- \brief Series for creating a bar chart.
+ \brief The QAbstractBarSeries class is an abstract parent class for all bar series classes.
- QAbstractBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars to
- the position defined by data. Single bar is defined by QPointF, where x value is the x-coordinate of the bar
- and y-value is the height of the bar. The category names are ignored with this series and x-axis
- shows the x-values.
+ In bar charts, bars are defined as bar sets that contain one data value for each category.
+ The position of a bar is specified by the category and its height by the data value. Bar
+ series that contain multiple bar sets group together bars that belong to the same category.
+ The way the bars are displayed is determined by the subclass of this class chosen to create
+ the bar chart.
- See the \l {BarChart Example} {bar chart example} to learn how to create a simple bar chart.
+ If a QValueAxis is used instead of QBarCategoryAxis for the main bar axis, the bars are
+ grouped around the index value of the category.
+
+ See the \l {BarChart Example} {bar chart example} to learn how to use the QBarSeries class
+ to create a simple bar chart.
\image examples_barchart.png
- \sa QBarSet, QStackedBarSeries, QPercentBarSeries
+ \sa QBarSet, QBarSeries, QStackedBarSeries, QPercentBarSeries
+ \sa QHorizontalBarSeries, QHorizontalStackedBarSeries, QHorizontalPercentBarSeries
*/
/*!
\qmltype AbstractBarSeries
@@ -65,9 +71,20 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractSeries
- \brief Series type for creating a bar chart.
+ \brief An abstract parent type for all bar series types.
+
+ In bar charts, bars are defined as bar sets that contain one data value for each category.
+ The position of a bar is specified by the category and its height by the data value. Bar
+ series that contain multiple bar sets group together bars that belong to the same category.
+ The way the bars are displayed is determined by the type chosen to create the bar chart:
+ BarSeries, StackedBarSeries, PercentBarSeries, HorizontalBarSeries, HorizontalStackedBarSeries,
+ or HorizontalPercentBarSeries.
+
+ If a ValueAxis type is used instead of a BarCategoryAxis type for the main bar axis, the
+ bars are grouped around the index value of the category.
- The following QML shows how to create a simple bar chart:
+ The following QML code snippet shows how to use the BarSeries and BarCategoryAxis type
+ to create a simple bar chart:
\snippet qmlchart/qml/qmlchart/View6.qml 1
\beginfloatleft
@@ -78,69 +95,79 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlproperty AbstractAxis AbstractBarSeries::axisX
- The x axis used for the series. If you leave both axisX and axisXTop undefined, a BarCategoriesAxis is created for
- the series.
+ The x-axis used for the series. If you leave both axisX and axisXTop undefined, a
+ BarCategoryAxis is created for the series.
\sa axisXTop
*/
/*!
\qmlproperty AbstractAxis AbstractBarSeries::axisY
- The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for
- the series.
+ The y-axis used for the series. If you leave both axisY and axisYRight undefined, a
+ ValueAxis is created for the series.
\sa axisYRight
*/
/*!
\qmlproperty AbstractAxis AbstractBarSeries::axisXTop
- The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or
- axisXTop, but not both.
+ The x-axis used for the series, drawn on top of the chart view.
+
+ \note You can only provide either axisX or axisXTop, but not both.
\sa axisX
*/
/*!
\qmlproperty AbstractAxis AbstractBarSeries::axisYRight
- The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY
- or axisYRight, but not both.
+ The y-axis used for the series, drawn to the right of the chart view.
+
+ \note You can only provide either axisY or axisYRight, but not both.
\sa axisY
*/
/*!
\property QAbstractBarSeries::barWidth
- The width of the bars of the series. The unit of \a width is the unit of x-axis. The minimum width for bars
- is zero and negative values are treated as zero. Setting the width to zero means that width of the bar on screen
- is one pixel no matter what the scale of x-axis is. Bars wider than zero are scaled with x-axis.
- Note that with QBarSeries this value means the width of one group of bars instead of just one bar.
+ \brief The width of the bars of the series.
+
+ The unit of width is the unit of the x-axis. The minimum width for bars is zero, and negative
+ values are treated as zero. Setting the width to zero means that the width of the bar on the
+ screen is one pixel regardless of the scale of the x-axis. Bars wider than zero are scaled
+ using the x-axis scale.
+
+ \note When used with QBarSeries, this value specifies the width of a group of bars instead of
+ that of a single bar.
\sa QBarSeries
*/
/*!
\qmlproperty real AbstractBarSeries::barWidth
- The width of the bars of the series. The unit of width is the unit of x-axis. The minimum width for bars
- is zero and negative values are treated as zero. Setting the width to zero means that width of the bar on screen
- is one pixel no matter what the scale of x-axis is. Bars wider than zero are scaled with x-axis.
- Note that with QBarSeries this value means the width of one group of bars instead of just one bar.
+ The unit of width is the unit of the x-axis. The minimum width for bars is zero, and negative
+ values are treated as zero. Setting the width to zero means that the width of the bar on the
+ screen is one pixel regardless of the scale of the x-axis. Bars wider than zero are scaled
+ using the x-axis scale.
+
+ \note When used with the BarSeries type, this value specifies the width of a group of bars
+ instead of that of a single bar.
*/
/*!
\property QAbstractBarSeries::count
- Holds the number of sets in series.
+ \brief The number of bar sets in a bar series.
*/
/*!
\qmlproperty int AbstractBarSeries::count
- Holds the number of sets in series.
+ The number of bar sets in a bar series.
*/
/*!
\property QAbstractBarSeries::labelsVisible
- Defines the visibility of the labels in series
+ \brief The visibility of the labels in a bar series.
*/
/*!
\qmlproperty bool AbstractBarSeries::labelsVisible
- Defines the visibility of the labels in series
+ The visibility of the labels in a bar series.
*/
/*!
\property QAbstractBarSeries::labelsFormat
- The \a format used for showing labels in series.
+ \brief The format used for showing labels in a bar series.
QAbstractBarSeries supports the following format tag:
\table
@@ -149,67 +176,73 @@ QT_CHARTS_BEGIN_NAMESPACE
\endtable
For example, the following usage of the format tags would produce labels that show the value
- followed by unit ('u'):
+ followed by the unit (u):
\code
series->setLabelsFormat("@value u");
\endcode
- By default, the labels shows the value of the bar. For percent bar series '%' is added after
- the value. The labels are shown on the plot area, labels on the edge of the plot area are cut.
- If the bars are close to each other the labels may overlap.
+ By default, the labels show the value of the bar. For the percent bar series, \e % is added
+ after the value. The labels are shown on the plot area, whereas labels on the edge of the plot
+ area are cut. If the bars are close to each other, the labels may overlap.
- \sa QAbstractBarSeries::labelsVisible, QAbstractBarSeries::labelsPosition
+ \sa labelsVisible, labelsPosition
*/
/*!
\qmlproperty string AbstractBarSeries::labelsFormat
- The format used for showing labels in series.
+ The format used for showing labels in a bar series.
- \sa QAbstractBarSeries::labelsFormat, labelsVisible, labelsPosition
+ \sa QAbstractBarSeries::labelsFormat, labelsVisible, LabelsPosition
*/
/*!
\fn void QAbstractBarSeries::labelsFormatChanged(const QString &format)
- Signal is emitted when the \a format of data value labels is changed.
+ This signal is emitted when the \a format of data value labels changes.
*/
/*!
\qmlsignal XYSeries::onLabelsFormatChanged(string format)
- Signal is emitted when the \a format of data value labels is changed.
+ This signal is emitted when the \a format of data value labels changes.
*/
/*!
\enum QAbstractBarSeries::LabelsPosition
- This enum describes the position of the data value labels.
+ This enum value describes the position of the data value labels:
- \value LabelsCenter Label is in the center of the bar.
- \value LabelsInsideEnd Label is inside the bar at the high end of it.
- \value LabelsInsideBase Label is inside the bar at the low end of it.
- \value LabelsOutsideEnd Label is outside the bar at the high end of it.
+ \value LabelsCenter Label is located in the center of the bar.
+ \value LabelsInsideEnd Label is located inside the bar at the top.
+ \value LabelsInsideBase Label is located inside the bar at the bottom.
+ \value LabelsOutsideEnd Label is located outside the bar at the top.
*/
/*!
\property QAbstractBarSeries::labelsPosition
- Defines the \a position of value labels.
+ \brief The position of value labels.
- \sa QAbstractBarSeries::labelsVisible, QAbstractBarSeries::labelsFormat
+ \sa labelsVisible, labelsFormat
*/
/*!
- \qmlproperty string AbstractBarSeries::labelsPosition
- Defines the \a position of value labels.
+ \qmlproperty enumeration AbstractBarSeries::LabelsPosition
+
+ The position of the data value labels:
+
+ \value LabelsCenter Label is located in the center of the bar.
+ \value LabelsInsideEnd Label is located inside the bar at the top.
+ \value LabelsInsideBase Label is located inside the bar at the bottom.
+ \value LabelsOutsideEnd Label is located outside the bar at the top.
\sa labelsVisible, labelsFormat
*/
/*!
\fn void QAbstractBarSeries::labelsPositionChanged(QAbstractBarSeries::LabelsPosition position)
- Signal is emitted when the \a position of value labels is changed.
+ This signal is emitted when the \a position of value labels changes.
*/
/*!
\qmlsignal AbstractBarSeries::onLabelsPositionChanged(LabelsPosition position)
- Signal is emitted when the \a position of value labels is changed.
+ This signal is emitted when the \a position of value labels changes.
*/
/*!
\property QAbstractBarSeries::labelsAngle
- The angle of the value labels in degrees.
+ \brief The angle of the value labels in degrees.
*/
/*!
\qmlproperty qreal QAbstractBarSeries::labelsAngle
@@ -217,117 +250,119 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\fn void QAbstractBarSeries::labelsAngleChanged(qreal angle)
- Signal is emitted when the \a angle of the value labels is changed.
+ This signal is emitted when the \a angle of the value labels changes.
*/
/*!
\qmlsignal AbstractBarSeries::onLabelsAngleChanged(qreal angle)
- Signal is emitted when the \a angle of the value labels is changed.
+ This signal is emitted when the \a angle of the value labels changes.
*/
/*!
\fn void QAbstractBarSeries::clicked(int index, QBarSet *barset)
- The signal is emitted if the user clicks with a mouse on top of QBarSet \a barset.
- Clicked bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index
+ in the bar set specified by \a barset.
*/
/*!
\qmlsignal AbstractBarSeries::onClicked(int index, BarSet barset)
- The signal is emitted if the user clicks with a mouse on top of BarSet.
- Clicked bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index
+ in the bar set specified by \a barset.
*/
/*!
\fn void QAbstractBarSeries::pressed(int index, QBarSet *barset)
- The signal is emitted if the user presses with a mouse on top of QBarSet \a barset.
- Pressed bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index
+ in the bar set specified by \a barset and holds down the mouse button.
*/
/*!
\qmlsignal AbstractBarSeries::onPressed(int index, BarSet barset)
- The signal is emitted if the user presses with a mouse on top of BarSet.
- Pressed bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index
+ in the bar set specified by \a barset and holds down the mouse button.
*/
/*!
\fn void QAbstractBarSeries::released(int index, QBarSet *barset)
- The signal is emitted if the user releases with a mouse on top of QBarSet \a barset.
- Released bar inside set is indexed by \a index
+ This signal is emitted when the user releases the mouse press on the bar
+ specified by \a index in the bar set specified by \a barset.
*/
/*!
\qmlsignal AbstractBarSeries::onReleased(int index, BarSet barset)
- The signal is emitted if the user releases with a mouse on top of BarSet.
- Released bar inside set is indexed by \a index
+ This signal is emitted when the user releases the mouse press on the bar
+ specified by \a index in the bar set specified by \a barset.
*/
/*!
\fn void QAbstractBarSeries::doubleClicked(int index, QBarSet *barset)
- The signal is emitted if the user doubleclicks with a mouse on top of QBarSet \a barset.
- DoubleClicked bar inside set is indexed by \a index
+ This signal is emitted when the user double-clicks the bar specified by \a index
+ in the bar set specified by \a barset.
*/
/*!
\qmlsignal AbstractBarSeries::onDoubleClicked(int index, BarSet barset)
- The signal is emitted if the user doubleclicks with a mouse on top of BarSet.
- Doubleclicked bar inside set is indexed by \a index
+ This signal is emitted when the user double-clicks the bar specified by \a index
+ in the bar set specified by \a barset.
*/
/*!
\fn void QAbstractBarSeries::hovered(bool status, int index, QBarSet* barset)
- The signal is emitted if mouse is hovered on top of series.
- Parameter \a barset is the pointer of barset, where hover happened.
- Parameter \a status is true, if mouse entered on top of series, false if mouse left from top of series.
- Hovered bar inside the set is indexed by \a index.
+ This signal is emitted when a mouse is hovered over the bar specified by \a index in the
+ bar set specified by \a barset. When the mouse moves over the bar, \a status turns \c true,
+ and when the mouse moves away again, it turns \c false.
*/
/*!
\qmlsignal AbstractBarSeries::onHovered(bool status, int index, BarSet barset)
- The signal is emitted if mouse is hovered on top of series.
- Parameter \a barset is the pointer of barset, where hover happened.
- Parameter \a status is true, if mouse entered on top of series, false if mouse left from top of series.
- Hovered bar inside the set is indexed by \a index.
+ This signal is emitted when a mouse is hovered over the bar specified by \a index in the
+ bar set specified by \a barset. When the mouse moves over the bar, \a status turns \c true,
+ and when the mouse moves away again, it turns \c false.
*/
/*!
\fn void QAbstractBarSeries::countChanged()
- This signal is emitted when barset count has been changed, for example by append or remove.
+ This signal is emitted when the number of bar sets is changed, for example by append() or
+ remove().
*/
/*!
\qmlsignal AbstractBarSeries::onCountChanged()
- This signal is emitted when barset count has been changed, for example by append or remove.
+ This signal is emitted when the number of bar sets is changed, for example by append() or
+ remove().
*/
/*!
\fn void QAbstractBarSeries::labelsVisibleChanged()
- This signal is emitted when labels visibility have changed.
+ This signal is emitted when the labels' visibility changes.
\sa isLabelsVisible(), setLabelsVisible()
*/
/*!
\fn void QAbstractBarSeries::barsetsAdded(QList<QBarSet*> sets)
- This signal is emitted when \a sets have been added to the series.
+ This signal is emitted when the bar sets specified by \a sets are added to the series.
\sa append(), insert()
*/
/*!
- \qmlsignal AbstractBarSeries::onBarsetsAdded(BarSet barset)
- Emitted when \a barset has been added to the series.
+ \qmlsignal AbstractBarSeries::onBarsetsAdded()
+ This signal is emitted when bar sets are added to the series.
*/
/*!
\fn void QAbstractBarSeries::barsetsRemoved(QList<QBarSet*> sets)
- This signal is emitted when \a sets have been removed from the series.
+ This signal is emitted when the bar sets specified by \a sets are removed from the series.
\sa remove()
*/
/*!
- \qmlsignal AbstractBarSeries::onBarsetsRemoved(BarSet barset)
- Emitted when \a barset has been removed from the series.
+ \qmlsignal AbstractBarSeries::onBarsetsRemoved()
+ This signal is emitted when bar sets are removed from the series.
*/
/*!
\qmlmethod BarSet AbstractBarSeries::at(int index)
- Returns bar set at \a index. Returns null if the index is not valid.
+ Returns the bar set at \a index. Returns null if the index is not valid.
*/
/*!
\qmlmethod BarSet AbstractBarSeries::append(string label, VariantList values)
- Adds a new bar set with \a label and \a values to \a index. Values is a list of reals.
+ Adds a new bar set with \a label and \a values to the index. \a values is
+ a list of real values.
+
For example:
\code
myBarSeries.append("set 1", [0, 0.2, 0.2, 0.5, 0.4, 1.5, 0.9]);
@@ -336,24 +371,29 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlmethod BarSet AbstractBarSeries::insert(int index, string label, VariantList values)
- Inserts a new bar set with \a label and \a values to \a index. Values can be a list of reals or a list of XYPoints.
- If index is zero or smaller, the new barset is prepended. If the index is count or bigger, the new barset is
- appended.
- \sa AbstractBarSeries::append()
+ Adds a new bar set with \a label and \a values to \a index. \a values can be a list
+ of real values or a list of XYPoint types.
+
+ If the index value is equal to or less than zero, the new bar set is prepended to the bar
+ series. If the index value is equal to or greater than the number of bar sets in the bar
+ series, the new bar set is appended to the bar series.
+
+ \sa append()
*/
/*!
\qmlmethod bool AbstractBarSeries::remove(BarSet barset)
- Removes the barset from the series. Returns true if successful, false otherwise.
+ Removes the bar set specified by \a barset from the series. Returns \c true if successful,
+ \c false otherwise.
*/
/*!
\qmlmethod AbstractBarSeries::clear()
- Removes all barsets from the series.
+ Removes all bar sets from the series.
*/
/*!
- Destructs abstractbarseries and owned barsets.
+ Removes the abstract bar series and the bar sets owned by it.
*/
QAbstractBarSeries::~QAbstractBarSeries()
{
@@ -371,10 +411,7 @@ QAbstractBarSeries::QAbstractBarSeries(QAbstractBarSeriesPrivate &o, QObject *pa
}
/*!
- Sets the width of the bars of the series. The unit of \a width is the unit of x-axis. The minimum width for bars
- is zero and negative values are treated as zero. Setting the width to zero means that width of the bar on screen
- is one pixel no matter what the scale of x-axis is. Bars wider than zero are scaled with x-axis.
- Note that with \link QBarSeries \endlink this value means the width of one group of bars instead of just one bar.
+ Sets the width of the bars of the series to \a width.
*/
void QAbstractBarSeries::setBarWidth(qreal width)
{
@@ -393,8 +430,9 @@ qreal QAbstractBarSeries::barWidth() const
}
/*!
- Adds a set of bars to series. Takes ownership of \a set. If the set is null or is already in series, it won't be appended.
- Returns true, if appending succeeded.
+ Adds a set of bars specified by \a set to the bar series and takes ownership of it. If the set
+ is null or it already belongs to the series, it will not be appended.
+ Returns \c true if appending succeeded.
*/
bool QAbstractBarSeries::append(QBarSet *set)
{
@@ -411,9 +449,8 @@ bool QAbstractBarSeries::append(QBarSet *set)
}
/*!
- Removes barset from series. Releases ownership of \a set. Deletes the set, if remove
- was successful.
- Returns true, if set was removed.
+ Removes the bar set specified by \a set from the series and permanently deletes it if
+ the removal succeeds. Returns \c true if the set was removed.
*/
bool QAbstractBarSeries::remove(QBarSet *set)
{
@@ -432,12 +469,11 @@ bool QAbstractBarSeries::remove(QBarSet *set)
}
/*!
- Takes a single \a set from the series. Does not delete the barset object.
-
- NOTE: The series remains as the barset's parent object. You must set the
+ Takes a single \a set from the series. Does not delete the bar set object.
+ \note The series remains the barset's parent object. You must set the
parent object to take full ownership.
- Returns true if take was successful.
+ Returns \c true if the take operation succeeds.
*/
bool QAbstractBarSeries::take(QBarSet *set)
{
@@ -453,10 +489,11 @@ bool QAbstractBarSeries::take(QBarSet *set)
}
/*!
- Adds a list of barsets to series. Takes ownership of \a sets.
- Returns true, if all sets were appended successfully. If any of the sets is null or is already appended to series,
- nothing is appended and function returns false. If any of the sets is in list more than once, nothing is appended
- and function returns false.
+ Adds a list of bar sets specified by \a sets to a bar series and takes ownership of the sets.
+ Returns \c true if all sets were appended successfully. If any of the sets is null or was
+ previously appended to the series, nothing is appended and this function returns \c false.
+ If any of the sets appears in the list more than once, nothing is appended and this function
+ returns \c false.
*/
bool QAbstractBarSeries::append(QList<QBarSet *> sets)
{
@@ -472,9 +509,9 @@ bool QAbstractBarSeries::append(QList<QBarSet *> sets)
}
/*!
- Insert a set of bars to series at \a index postion. Takes ownership of \a set. If the set is null or is already in series, it won't be appended.
- Returns true, if inserting succeeded.
-
+ Inserts a bar set specified by \a set to a series at the position specified by \a index
+ and takes ownership of the set. If the set is null or already belongs to the series, it will
+ not be appended. Returns \c true if inserting succeeds.
*/
bool QAbstractBarSeries::insert(int index, QBarSet *set)
{
@@ -490,7 +527,7 @@ bool QAbstractBarSeries::insert(int index, QBarSet *set)
}
/*!
- Removes all barsets from the series. Deletes removed sets.
+ Removes all bar sets from the series and permanently deletes them.
*/
void QAbstractBarSeries::clear()
{
@@ -506,7 +543,7 @@ void QAbstractBarSeries::clear()
}
/*!
- Returns number of sets in series.
+ Returns the number of bar sets in a bar series.
*/
int QAbstractBarSeries::count() const
{
@@ -515,7 +552,7 @@ int QAbstractBarSeries::count() const
}
/*!
- Returns a list of sets in series. Keeps ownership of sets.
+ Returns a list of bar sets in a bar series. Keeps the ownership of the bar sets.
*/
QList<QBarSet *> QAbstractBarSeries::barSets() const
{
@@ -524,7 +561,7 @@ QList<QBarSet *> QAbstractBarSeries::barSets() const
}
/*!
- Sets the visibility of labels in series to \a visible
+ Sets the visibility of labels in a bar series to \a visible.
*/
void QAbstractBarSeries::setLabelsVisible(bool visible)
{
@@ -536,7 +573,7 @@ void QAbstractBarSeries::setLabelsVisible(bool visible)
}
/*!
- Returns the visibility of labels
+ Returns the visibility of labels.
*/
bool QAbstractBarSeries::isLabelsVisible() const
{
diff --git a/src/charts/barchart/qbarmodelmapper.cpp b/src/charts/barchart/qbarmodelmapper.cpp
index 500429f8..36a9ca53 100644
--- a/src/charts/barchart/qbarmodelmapper.cpp
+++ b/src/charts/barchart/qbarmodelmapper.cpp
@@ -36,6 +36,16 @@
QT_CHARTS_BEGIN_NAMESPACE
+/*!
+ \class QBarModelMapper
+ \inmodule Qt Charts
+ \brief The QBarModelMapper class is the base class for model mapper classes.
+ \internal
+
+ Model mappers enable using a data model derived from the QAbstractItemModel class
+ as a data source for a chart.
+*/
+
QBarModelMapper::QBarModelMapper(QObject *parent) :
QObject(parent),
d_ptr(new QBarModelMapperPrivate(this))
diff --git a/src/charts/barchart/qbarset.cpp b/src/charts/barchart/qbarset.cpp
index 85175cb2..be00356f 100644
--- a/src/charts/barchart/qbarset.cpp
+++ b/src/charts/barchart/qbarset.cpp
@@ -37,75 +37,79 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QBarSet
\inmodule Qt Charts
- \brief Building block for different bar charts.
+ \brief The QBarSet class represents one set of bars in a bar chart.
- QBarSet represents one set of bars. Set of bars contains one data value for each category.
- First value of set is assumed to belong to first category, second to second category and so on.
- If set has fewer values than there are categories, then the missing values are assumed to be
- at the end of set. For missing values in middle of a set, numerical value of zero is used.
+ A bar set contains one data value for each category. The first value of a set is assumed to
+ belong to the first category, the second one to the second category, and so on. If the set has
+ fewer values than there are categories, the missing values are assumed to be located at the end
+ of the set. For missing values in the middle of a set, the numerical value of zero is used.
Labels for zero value sets are not shown.
\sa QAbstractBarSeries, QBarSeries, QStackedBarSeries, QPercentBarSeries
+ \sa QHorizontalBarSeries, QHorizontalStackedBarSeries, QHorizontalPercentBarSeries
*/
/*!
\qmltype BarSet
\instantiates QBarSet
\inqmlmodule QtCharts
- \brief Building block for different bar charts.
+ \brief Represents one set of bars in a bar chart.
- BarSet represents one set of bars. Set of bars contains one data value for each category.
- First value of set is assumed to belong to first category, second to second category and so on.
- If set has fewer values than there are categories, then the missing values are assumed to be
- at the end of set. For missing values in middle of a set, numerical value of zero is used.
+ A bar set contains one data value for each category. The first value of a set is assumed to
+ belong to the first category, the second one to the second category, and so on. If the set has
+ fewer values than there are categories, the missing values are assumed to be located at the end
+ of the set. For missing values in the middle of a set, the numerical value of zero is used.
Labels for zero value sets are not shown.
+
\sa AbstractBarSeries, BarSeries, StackedBarSeries, PercentBarSeries
+ \sa HorizontalBarSeries, HorizontalStackedBarSeries, HorizontalPercentBarSeries
+
*/
/*!
\property QBarSet::label
- Defines the label of the bar set.
+ \brief The label of the bar set.
*/
/*!
\qmlproperty string BarSet::label
- Defines the label of the bar set.
+ The label of the bar set.
*/
/*!
\property QBarSet::pen
- \brief Defines the pen used by the bar set.
+ \brief The pen used to draw the lines of bars in the bar set.
*/
/*!
\property QBarSet::brush
- \brief Defines the brush used by the bar set.
+ \brief The brush used to fill the bars in the bar set.
*/
/*!
- \qmlproperty QString BarSet::brushFilename
+ \qmlproperty string BarSet::brushFilename
The name of the file used as a brush for the set.
*/
/*!
\property QBarSet::labelBrush
- \brief Defines the brush used by the bar set's label.
+ \brief The brush used to draw the bar set's label.
*/
/*!
\property QBarSet::labelFont
- \brief Defines the font used by the bar set's label.
+ \brief The font used to draw the bar set's label.
*/
/*!
- \qmlproperty Font BarSet::labelFont
- Defines the font used by the bar set's label.
+ \qmlproperty font BarSet::labelFont
+ The font used to draw the bar set's label.
- See the Qt documentation for more details of Font.
+ For more information, see \l [QML]{font}.
*/
/*!
\property QBarSet::color
- The fill (brush) color of the bar set.
+ \brief The fill (brush) color of the bar set.
*/
/*!
\qmlproperty color BarSet::color
@@ -114,7 +118,7 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QBarSet::borderColor
- The line (pen) color of the bar set.
+ \brief The line (pen) color of the bar set.
*/
/*!
\qmlproperty color BarSet::borderColor
@@ -123,12 +127,12 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlproperty real BarSet::borderWidth
- The width of the border line. By default the width is 2.0.
+ The width of the border line. By default, the width is 2.0.
*/
/*!
\property QBarSet::labelColor
- The text (label) color of the bar set.
+ \brief The text (label) color of the bar set.
*/
/*!
\qmlproperty color BarSet::labelColor
@@ -138,158 +142,155 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\fn void QBarSet::clicked(int index)
- The signal is emitted if the user clicks with a mouse on top of bar set.
- Clicked bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index in a bar set.
*/
/*!
\fn void QBarSet::pressed(int index)
- The signal is emitted if the user presses with a mouse on top of bar set.
- Pressed bar inside set is indexed by \a index
+ This signal is emitted when the user clicks the bar specified by \a index in a bar set
+ and holds down the mouse button.
*/
/*!
\fn void QBarSet::released(int index)
- The signal is emitted if the user releases with a mouse on top of bar set.
- Released bar inside set is indexed by \a index
+ This signal is emitted when the user releases the mouse press on the bar specified by
+ \a index in a bar set.
*/
/*!
\fn void QBarSet::doubleClicked(int index)
- The signal is emitted if the user doubleclicks with a mouse on top of bar set.
- Doubleclicked bar inside set is indexed by \a index
+ This signal is emitted when the user double-clicks the bar specified by \a index in a bar set.
*/
/*!
\fn void QBarSet::hovered(bool status, int index)
- The signal is emitted if mouse is hovered on top of bar set.
- Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set.
- Hovered bar inside the set is indexed by \a index.
+ This signal is emitted when a mouse is hovered over the bar specified by \a index in a bar set.
+ When the mouse moves over the bar, \a status turns \c true, and when the mouse moves away again,
+ it turns \c false.
*/
/*!
\fn void QBarSet::labelChanged()
- This signal is emitted when the label of the bar set has changed.
+ This signal is emitted when the label of the bar set changes.
\sa label
*/
/*!
\qmlsignal BarSet::onLabelChanged()
- This signal is emitted when the label of the bar set has changed.
+ This signal is emitted when the label of the bar set changes.
*/
/*!
\fn void QBarSet::penChanged()
- This signal is emitted when the pen of the bar set has changed.
+ This signal is emitted when the pen used to draw the bar set changes.
\sa pen
*/
/*!
\fn void QBarSet::brushChanged()
- This signal is emitted when the brush of the bar set has changed.
+ This signal is emitted when the brush used to draw the bar set changes.
\sa brush
*/
/*!
\fn void QBarSet::labelBrushChanged()
- This signal is emitted when the brush of the bar set's label has changed.
+ This signal is emitted when the brush used to draw the bar set's label changes.
\sa labelBrush
*/
/*!
\fn void QBarSet::labelFontChanged()
- This signal is emitted when the font of the bar set's label has changed.
+ This signal is emitted when the font of the bar set's label changes.
\sa labelBrush
*/
/*!
\fn void QBarSet::colorChanged(QColor)
- This signal is emitted when the fill (brush) color of the set has changed to \a color.
+ This signal is emitted when the fill (brush) color of the bar set changes to \a color.
*/
/*!
\qmlsignal BarSet::onColorChanged(color color)
- This signal is emitted when the fill (brush) color of the set has changed to \a color.
+ This signal is emitted when the fill (brush) color of the bar set changes to \a color.
*/
/*!
\fn void QBarSet::borderColorChanged(QColor)
- This signal is emitted when the line (pen) color of the set has changed to \a color.
+ This signal is emitted when the line (pen) color of the bar set changes to \a color.
*/
/*!
\qmlsignal BarSet::onBorderColorChanged(color color)
- This signal is emitted when the line (pen) color of the set has changed to \a color.
+ This signal is emitted when the line (pen) color of the bar set changes to \a color.
*/
/*!
\fn void QBarSet::labelColorChanged(QColor)
- This signal is emitted when the text (label) color of the set has changed to \a color.
+ This signal is emitted when the text (label) color of the bar set changes to \a color.
*/
/*!
\qmlsignal BarSet::onLabelColorChanged(color color)
- This signal is emitted when the text (label) color of the set has changed to \a color.
+ This signal is emitted when the text (label) color of the bar set changes to \a color.
*/
/*!
\fn void QBarSet::valuesAdded(int index, int count)
- This signal is emitted when new values have been added to the set.
- Parameter \a index indicates the position of the first inserted value.
- Parameter \a count is the number of inserted values.
+ This signal is emitted when new values are added to the bar set.
+ \a index indicates the position of the first inserted value, and \a count is the number
+ of inserted values.
\sa append(), insert()
*/
/*!
\qmlsignal BarSet::onValuesAdded(int index, int count)
- This signal is emitted when new values have been added to the set.
- Parameter \a index indicates the position of the first inserted value.
- Parameter \a count is the number of inserted values.
+ This signal is emitted when new values are added to the bar set.
+ \a index indicates the position of the first inserted value, and \a count is the number
+ of inserted values.
*/
/*!
\fn void QBarSet::valuesRemoved(int index, int count)
- This signal is emitted values have been removed from the set.
- Parameter \a index indicates the position of the first removed value.
- Parameter \a count is the number of removed values.
+ This signal is emitted when values are removed from the bar set.
+ \a index indicates the position of the first removed value, and \a count is the number
+ of removed values.
\sa remove()
*/
/*!
\qmlsignal BarSet::onValuesRemoved(int index, int count)
- This signal is emitted values have been removed from the set.
- Parameter \a index indicates the position of the first removed value.
- Parameter \a count is the number of removed values.
+ This signal is emitted when values are removed from the bar set.
+ \a index indicates the position of the first removed value, and \a count is the number
+ of removed values.
*/
/*!
\fn void QBarSet::valueChanged(int index)
- This signal is emitted values the value in the set has been modified.
- Parameter \a index indicates the position of the modified value.
+ This signal is emitted when the value at the position specified by \a index is modified.
\sa at()
*/
/*!
\qmlsignal BarSet::onValueChanged(int index)
- This signal is emitted values the value in the set has been modified.
- Parameter \a index indicates the position of the modified value.
+ This signal is emitted when the value at the position specified by \a index is modified.
*/
/*!
\qmlproperty int BarSet::count
- The count of values on the bar set
+ The number of values in the bar set.
*/
/*!
\qmlproperty QVariantList BarSet::values
- The values of the bar set. You can set either a list of reals or a list of points as values.
+ The values of the bar set. You can set a list of either \l [QML]{real} or \l [QML]{point}
+ types as values.
- If you set a list of reals as values, the values directly define the bar set values.
+ If you set a list of real types as values, they directly define the bar set values.
- If you set a list of points as values, the x-coordinate of the point specifies its zero-based
- index in the bar set. The size of the bar set is the highest x-coordinate value + 1.
+ If you set a list of point types as values, the x-coordinate of the point specifies its
+ zero-based index in the bar set. The size of the bar set is the highest x-coordinate value + 1.
If a point is missing for any x-coordinate between zero and the highest value,
- it gets value zero.
+ it gets the value zero.
- For example the following sets have equal values:
+ For example, the following bar sets have equal values:
\code
myBarSet1.values = [5, 0, 1, 5];
myBarSet2.values = [Qt.point(0, 5), Qt.point(2, 1), Qt.point(3, 5)];
@@ -297,7 +298,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs QBarSet with a label of \a label and with parent of \a parent.
+ Constructs a bar set with the label \a label and the parent \a parent.
*/
QBarSet::QBarSet(const QString label, QObject *parent)
: QObject(parent),
@@ -306,7 +307,7 @@ QBarSet::QBarSet(const QString label, QObject *parent)
}
/*!
- Destroys the bar set.
+ Removes the bar set.
*/
QBarSet::~QBarSet()
{
@@ -314,7 +315,7 @@ QBarSet::~QBarSet()
}
/*!
- Sets new \a label for set.
+ Sets \a label as the new label for the bar set.
*/
void QBarSet::setLabel(const QString label)
{
@@ -324,7 +325,7 @@ void QBarSet::setLabel(const QString label)
}
/*!
- Returns label of the set.
+ Returns the label of the bar set.
*/
QString QBarSet::label() const
{
@@ -332,7 +333,7 @@ QString QBarSet::label() const
}
/*!
- Appends new value \a value to the end of set.
+ Appends the new value specified by \a value to the end of the bar set.
*/
void QBarSet::append(const qreal value)
{
@@ -343,8 +344,8 @@ void QBarSet::append(const qreal value)
}
/*!
- Appends a list of reals to set. Works like append with single real value. The \a values in list
- are appended to end of bar set.
+ Appends the list of real values specified by \a values to the end of the bar set.
+
\sa append()
*/
void QBarSet::append(const QList<qreal> &values)
@@ -355,7 +356,9 @@ void QBarSet::append(const QList<qreal> &values)
}
/*!
- Convenience operator. Same as append, with real \a value.
+ A convenience operator for appending the real value specified by \a value to the end of the
+ bar set.
+
\sa append()
*/
QBarSet &QBarSet::operator << (const qreal &value)
@@ -365,8 +368,9 @@ QBarSet &QBarSet::operator << (const qreal &value)
}
/*!
- Inserts new \a value on the \a index position.
- The value that is currently at this postion is moved to position index + 1
+ Inserts \a value in the position specified by \a index.
+ The values following the inserted value are moved up one position.
+
\sa remove()
*/
void QBarSet::insert(const int index, const qreal value)
@@ -376,7 +380,8 @@ void QBarSet::insert(const int index, const qreal value)
}
/*!
- Removes \a count number of values from the set starting at \a index.
+ Removes the number of values specified by \a count from the bar set starting with
+ the value specified by \a index.
\sa insert()
*/
void QBarSet::remove(const int index, const int count)
@@ -388,7 +393,7 @@ void QBarSet::remove(const int index, const int count)
}
/*!
- Sets a new value \a value to set, indexed by \a index.
+ Adds the value specified by \a value to the bar set at the position specified by \a index.
*/
void QBarSet::replace(const int index, const qreal value)
{
@@ -399,8 +404,8 @@ void QBarSet::replace(const int index, const qreal value)
}
/*!
- Returns value of set indexed by \a index.
- If the index is out of bounds 0.0 is returned.
+ Returns the value specified by \a index from the bar set.
+ If the index is out of bounds, 0.0 is returned.
*/
qreal QBarSet::at(const int index) const
{
@@ -410,8 +415,8 @@ qreal QBarSet::at(const int index) const
}
/*!
- Returns value of set indexed by \a index.
- If the index is out of bounds 0.0 is returned.
+ Returns the value of the bar set specified by \a index.
+ If the index is out of bounds, 0.0 is returned.
*/
qreal QBarSet::operator [](const int index) const
{
@@ -419,7 +424,7 @@ qreal QBarSet::operator [](const int index) const
}
/*!
- Returns count of values in set.
+ Returns the number of values in a bar set.
*/
int QBarSet::count() const
{
@@ -427,7 +432,7 @@ int QBarSet::count() const
}
/*!
- Returns sum of all values in the bar set.
+ Returns the sum of all values in the bar set.
*/
qreal QBarSet::sum() const
{
@@ -438,7 +443,7 @@ qreal QBarSet::sum() const
}
/*!
- Sets pen for set. Bars of this set are drawn using \a pen
+ Sets the pen used to draw the lines in the bar set to \a pen.
*/
void QBarSet::setPen(const QPen &pen)
{
@@ -451,7 +456,7 @@ void QBarSet::setPen(const QPen &pen)
}
/*!
- Returns pen of the set.
+ Returns the pen used to draw the lines in the bar set.
*/
QPen QBarSet::pen() const
{
@@ -462,7 +467,7 @@ QPen QBarSet::pen() const
}
/*!
- Sets brush for the set. Bars of this set are drawn using \a brush.
+ Sets the brush used to fill the bars in the bar set to \a brush.
*/
void QBarSet::setBrush(const QBrush &brush)
{
@@ -475,7 +480,7 @@ void QBarSet::setBrush(const QBrush &brush)
}
/*!
- Returns brush of the set.
+ Returns the brush used to fill the bars in the bar set.
*/
QBrush QBarSet::brush() const
{
@@ -486,7 +491,7 @@ QBrush QBarSet::brush() const
}
/*!
- Sets \a brush of the values that are drawn on top of this bar set.
+ Sets the brush used to draw values on top of this bar set to \a brush.
*/
void QBarSet::setLabelBrush(const QBrush &brush)
{
@@ -499,7 +504,7 @@ void QBarSet::setLabelBrush(const QBrush &brush)
}
/*!
- Returns brush of the values that are drawn on top of this bar set.
+ Returns the brush used to draw values on top of this bar set.
*/
QBrush QBarSet::labelBrush() const
{
@@ -510,7 +515,7 @@ QBrush QBarSet::labelBrush() const
}
/*!
- Sets the \a font for values that are drawn on top of this bar set.
+ Sets the font used to draw values on top of this bar set to \a font.
*/
void QBarSet::setLabelFont(const QFont &font)
{
@@ -523,7 +528,7 @@ void QBarSet::setLabelFont(const QFont &font)
}
/*!
- Returns the pen for values that are drawn on top of this bar set.
+ Returns the pen used to draw values on top of this bar set.
*/
QFont QBarSet::labelFont() const
{
@@ -531,7 +536,7 @@ QFont QBarSet::labelFont() const
}
/*!
- Returns the color of the brush of bar set.
+ Returns the fill color for the bar set.
*/
QColor QBarSet::color()
{
@@ -539,7 +544,7 @@ QColor QBarSet::color()
}
/*!
- Sets the \a color of brush for this bar set.
+ Sets the fill color for the bar set to \a color.
*/
void QBarSet::setColor(QColor color)
{
@@ -559,7 +564,7 @@ void QBarSet::setColor(QColor color)
}
/*!
- Returns the color of pen of this bar set.
+ Returns the line color for the bar set.
*/
QColor QBarSet::borderColor()
{
@@ -567,7 +572,7 @@ QColor QBarSet::borderColor()
}
/*!
- Sets the \a color of pen for this bar set.
+ Sets the line color for the bar set to \a color.
*/
void QBarSet::setBorderColor(QColor color)
{
@@ -580,7 +585,7 @@ void QBarSet::setBorderColor(QColor color)
}
/*!
- Returns the color of labels of this bar set.
+ Returns the text color for the bar set.
*/
QColor QBarSet::labelColor()
{
@@ -588,7 +593,7 @@ QColor QBarSet::labelColor()
}
/*!
- Sets the \a color of labels for this bar set.
+ Sets the text color for the bar set to \a color.
*/
void QBarSet::setLabelColor(QColor color)
{
diff --git a/src/charts/barchart/qhbarmodelmapper.cpp b/src/charts/barchart/qhbarmodelmapper.cpp
index 258660d7..ceb0c915 100644
--- a/src/charts/barchart/qhbarmodelmapper.cpp
+++ b/src/charts/barchart/qhbarmodelmapper.cpp
@@ -34,13 +34,21 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QHBarModelMapper
\inmodule Qt Charts
- \brief Horizontal model mapper for bar series.
+ \brief The QHBarModelMapper class is a horizontal model mapper for bar series.
+
+ Model mappers enable using a data model derived from the QAbstractItemModel class
+ as a data source for a chart. A horizontal model mapper is used to create a connection
+ between a data model and QAbstractBarSeries, so that each row in the data model
+ defines a bar set and each column maps to a category in a bar series.
+
+ Both model and bar series properties can be used to manipulate the data. The model mapper
+ keeps the bar series and the data model in sync.
- Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series.
- Horizontal model mapper is used to create a connection between QAbstractBarSeries and QAbstractItemModel derived model object.
- Model mapper maintains equal size of all the BarSets.
- Adding/removing value from the BarSet causes the the same change in the rest of the BarSets added to the same series.
- \note Used model has to support adding/removing rows/columns and modifying the data of the cells.
+ The model mapper ensures that all the bar sets in the bar series have equal sizes.
+ Therefore, adding or removing a value from a bar set causes the same change to be
+ made in all the bar sets in the bar series.
+
+ \sa QVBarModelMapper
*/
/*!
\qmltype HBarModelMapper
@@ -49,13 +57,22 @@ QT_CHARTS_BEGIN_NAMESPACE
\brief Horizontal model mapper for bar series.
- HBarModelMapper allows you to use your own QAbstractItemModel derived model with data in rows as
- a data source for any bar series. It is possible to use both QAbstractItemModel and bar series
- data API to manipulate data. HBarModelMapper keeps the series and the model in sync.
+ The HBarModelMapper type enables using a data model derived from the QAbstractItemModel
+ class as a data source for a chart. A horizontal model mapper is used to create a connection
+ between a data model and AbstractBarSeries, so that each row in the data model
+ defines a bar set and each column maps to a category in a bar series. You need to implement
+ the data model and expose it to QML.
+
+ Both model and bar series properties can be used to manipulate the data. The model mapper
+ keeps the bar series and the data model in sync.
- The following QML example would create a bar series with three bar sets (assuming the model has
- at least four rows). Each bar set would contain data starting from column 1. The name of a set
- would be defined by the vertical header (of the row).
+ The model mapper ensures that all the bar sets in the bar series have equal sizes.
+ Therefore, adding or removing a value from a bar set causes the same change to be
+ made in all the bar sets in the bar series.
+
+ The following QML code snippet creates a bar series with three bar sets (assuming the model
+ has at least four rows). Each bar set contains data starting from column 1. The name
+ of a bar set is defined by the row header.
\code
BarSeries {
HBarModelMapper {
@@ -66,19 +83,22 @@ QT_CHARTS_BEGIN_NAMESPACE
}
}
\endcode
+
+ \sa VBarModelMapper
*/
/*!
\property QHBarModelMapper::series
- \brief Defines the QPieSeries object that is used by the mapper.
+ \brief The bar series that is used by the mapper.
All the data in the series is discarded when it is set to the mapper.
- When new series is specified the old series is disconnected (it preserves its data)
+ When a new series is specified, the old series is disconnected (but it preserves its data).
*/
/*!
\qmlproperty AbstractBarSeries HBarModelMapper::series
- Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is
- set to the mapper. When new series is specified the old series is disconnected (it preserves its data).
+ The bar series that is used by the mapper. All the data in the series is discarded when it is
+ set to the mapper. When the new series is specified, the old series is disconnected (but it
+ preserves its data).
*/
/*!
@@ -87,95 +107,96 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\qmlproperty SomeModel HBarModelMapper::model
- The QAbstractItemModel based model that is used by the mapper. You need to implement the model
- and expose it to QML. Note: the model has to support adding/removing rows/columns and modifying
- the data of the cells.
+ The data model that is used by the mapper. You need to implement the model and expose it to QML.
+
+ \note The model has to support adding and removing rows or columns and modifying
+ the data in the cells.
*/
/*!
\property QHBarModelMapper::firstBarSetRow
- \brief Defines which column of the model is used as the data source for the first bar set.
+ \brief The row of the model that is used as the data source for the first bar set.
- Default value is: -1 (invalid mapping)
+ The default value is -1 (invalid mapping).
*/
/*!
\qmlproperty int HBarModelMapper::firstBarSetRow
- Defines which column of the model is used as the data source for the first bar set. The default value is -1
+ Defines which row of the model is used as the data source for the first bar set. The default value is -1
(invalid mapping).
*/
/*!
\property QHBarModelMapper::lastBarSetRow
- \brief Defines which column of the model is used as the data source for the last bar set.
+ \brief The row of the model that is used as the data source for the last bar set.
- Default value is: -1 (invalid mapping)
+ The default value is -1 (invalid mapping).
*/
/*!
\qmlproperty int HBarModelMapper::lastBarSetRow
- Defines which column of the model is used as the data source for the last bar set. The default value is -1
- (invalid mapping).
+ The row of the model that is used as the data source for the last bar set. The default
+ value is -1 (invalid mapping).
*/
/*!
\property QHBarModelMapper::firstColumn
- \brief Defines which column of the model contains the first values of the QBarSets in the series.
+ \brief The column of the model that contains the first values of the bar sets in the bar series.
- Minimal and default value is: 0
+ The minimum and default value is 0.
*/
/*!
\qmlproperty int HBarModelMapper::firstColumn
- Defines which column of the model contains the first values of the QBarSets in the series.
+ The column of the model that contains the first values of the bar sets in the bar series.
The default value is 0.
*/
/*!
\property QHBarModelMapper::columnCount
- \brief Defines the number of columns of the model that are mapped as the data for QAbstractBarSeries.
+ \brief The number of columns of the model that are mapped as the data for the bar series.
- Minimal and default value is: -1 (count limited by the number of columns in the model)
+ The minimum and default value is -1 (number limited to the number of columns in the model).
*/
/*!
\qmlproperty int HBarModelMapper::columnCount
- Defines the number of columns of the model that are mapped as the data for QAbstractBarSeries. The default value is
- -1 (count limited by the number of columns in the model)
+ The number of columns of the model that are mapped as the data for the bar series. The default
+ value is -1 (number limited to the number of columns in the model).
*/
/*!
\fn void QHBarModelMapper::seriesReplaced()
- Emitted when the series to which mapper is connected to has changed.
+ This signal is emitted when the series that the mapper is connected to changes.
*/
/*!
\fn void QHBarModelMapper::modelReplaced()
- Emitted when the model to which mapper is connected to has changed.
+ This signal is emitted when the model that the mapper is connected to changes.
*/
/*!
\fn void QHBarModelMapper::firstBarSetRowChanged()
- Emitted when the firstBarSetRow has changed.
+ This signal is emitted when the first bar set row changes.
*/
/*!
\fn void QHBarModelMapper::lastBarSetRowChanged()
- Emitted when the lastBarSetRow has changed.
+ This signal is emitted when the last bar set row changes.
*/
/*!
\fn void QHBarModelMapper::firstColumnChanged()
- Emitted when the firstColumn has changed.
+ This signal is emitted when the first column changes.
*/
/*!
\fn void QHBarModelMapper::columnCountChanged()
- Emitted when the columnCount has changed.
+ This signal is emitted when the number of columns changes.
*/
/*!
- Constructs a mapper object which is a child of \a parent.
+ Constructs a mapper object that is a child of \a parent.
*/
QHBarModelMapper::QHBarModelMapper(QObject *parent) :
QBarModelMapper(parent)
diff --git a/src/charts/barchart/qvbarmodelmapper.cpp b/src/charts/barchart/qvbarmodelmapper.cpp
index 13b0fac1..99b94e6a 100644
--- a/src/charts/barchart/qvbarmodelmapper.cpp
+++ b/src/charts/barchart/qvbarmodelmapper.cpp
@@ -34,13 +34,23 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QVBarModelMapper
\inmodule Qt Charts
- \brief Vertical model mapper for bar series.
+ \brief The QVBarModelMapper class is a vertical model mapper for bar series.
+
+ Model mappers enable using a data model derived from the QAbstractItemModel class
+ as a data source for a chart. A vertical model mapper is used to create a connection
+ between a data model and QAbstractBarSeries, so that each column in the data model
+ defines a bar set and each row maps to a category in a bar series.
+
+ Both model and bar series properties can be used to manipulate the data. The model mapper
+ keeps the bar series and the data model in sync.
+
+ The model mapper ensures that all the bar sets in the bar series have equal sizes.
+ Therefore, adding or removing a value from a bar set causes the same change to be
+ made in all the bar sets in the bar series.
+
+ For more information, see \l{BarModelMapper Example}.
- Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series.
- Vertical model mapper is used to create a connection between QAbstractBarSeries and QAbstractItemModel derived model object.
- Model mapper maintains equal size of all the BarSets.
- Adding/removing value from the BarSet causes the the same change in the rest of the BarSets added to the same series.
- \note Used model has to support adding/removing rows/columns and modifying the data of the cells.
+ \sa QHBarModelMapper
*/
/*!
\qmltype VBarModelMapper
@@ -51,13 +61,22 @@ QT_CHARTS_BEGIN_NAMESPACE
\brief Vertical model mapper for bar series.
- VBarModelMapper allows you to use your own QAbstractItemModel derived model with data in columns
- as a data source for any bar series. It is possible to use both QAbstractItemModel and bar
- series data API to manipulate data. VBarModelMapper keeps the series and the model in sync.
+ The VBarModelMapper type enables using a data model derived from the QAbstractItemModel
+ class as a data source for a chart. A vertical model mapper is used to create a connection
+ between a data model and QAbstractBarSeries, so that each column in the data model
+ defines a bar set and each row maps to a category in a bar series. You need to implement
+ the data model and expose it to QML.
- The following QML example would create a bar series with three bar sets (assuming the model has
- at least four columns). Each bar set would contain data starting from row 1. The name of a set
- would be defined by the horizontal header (of the column).
+ Both model and bar series properties can be used to manipulate the data. The model mapper
+ keeps the bar series and the data model in sync.
+
+ The model mapper ensures that all the bar sets in the bar series have equal sizes.
+ Therefore, adding or removing a value from a bar set causes the same change to be
+ made in all the bar sets in the bar series.
+
+ The following QML code snippet creates a bar series with three bar sets (assuming the model
+ has at least four columns). Each bar set contains data starting from row 1. The name
+ of a bar set is defined by the column header.
\code
BarSeries {
VBarModelMapper {
@@ -68,114 +87,118 @@ QT_CHARTS_BEGIN_NAMESPACE
}
}
\endcode
+
+ \sa HBarModelMapper
*/
/*!
\property QVBarModelMapper::series
- \brief Defines the QBarSeries object that is used by the mapper.
+ \brief The bar series that is used by the mapper.
All the data in the series is discarded when it is set to the mapper.
- When new series is specified the old series is disconnected (it preserves its data)
+ When a new series is specified, the old series is disconnected (but it preserves its data).
*/
/*!
\qmlproperty AbstractBarSeries VBarModelMapper::series
- Defines the AbstractBarSeries based object that is used by the mapper. All the data in the series is discarded when it is
- set to the mapper. When new series is specified the old series is disconnected (it preserves its data).
+ The bar series that is used by the mapper. All the data in the series is discarded when it is
+ set to the mapper. When the new series is specified, the old series is disconnected (but it
+ preserves its data).
*/
/*!
\property QVBarModelMapper::model
- \brief Defines the model that is used by the mapper.
+ \brief The data model that is used by the mapper.
*/
/*!
\qmlproperty SomeModel VBarModelMapper::model
- The QAbstractItemModel based model that is used by the mapper. You need to implement the model
- and expose it to QML. Note: the model has to support adding/removing rows/columns and modifying
- the data of the cells.
+ The data model that is used by the mapper. You need to implement the model and expose it to QML.
+
+ \note The model has to support adding and removing rows or columns and modifying
+ the data in the cells.
*/
/*!
\property QVBarModelMapper::firstBarSetColumn
- \brief Defines which column of the model is used as the data source for the first bar set.
+ \brief The column of the model that is used as the data source for the first bar set.
- Default value is: -1 (invalid mapping)
+ The default value is -1 (invalid mapping).
*/
/*!
\qmlproperty int VBarModelMapper::firstBarSetColumn
- Defines which column of the model is used as the data source for the first bar set. Default value
- is: -1 (invalid mapping).
+ The column of the model that is used as the data source for the first bar set. The default value
+ is -1 (invalid mapping).
*/
/*!
\property QVBarModelMapper::lastBarSetColumn
- \brief Defines which column of the model is used as the data source for the last bar set.
+ \brief The column of the model that is used as the data source for the last bar set.
- Default value is: -1 (invalid mapping)
+ The default value is -1 (invalid mapping).
*/
/*!
\qmlproperty int VBarModelMapper::lastBarSetColumn
- Defines which column of the model is used as the data source for the last bar set. Default
- value is: -1 (invalid mapping).
+ The column of the model that is used as the data source for the last bar set. The default
+ value is -1 (invalid mapping).
*/
/*!
\property QVBarModelMapper::firstRow
- \brief Defines which row of the model contains the first values of the QBarSets in the series.
+ \brief The row of the model that contains the first values of the bar sets in the bar series.
- Minimal and default value is: 0
+ The minimum and default value is 0.
*/
/*!
\qmlproperty int VBarModelMapper::firstRow
- Defines which row of the model contains the first values of the QBarSets in the series.
+ The row of the model that contains the first values of the bar sets in the bar series.
The default value is 0.
*/
/*!
\property QVBarModelMapper::rowCount
- \brief Defines the number of rows of the model that are mapped as the data for QAbstractBarSeries.
+ \brief The number of rows of the model that are mapped as the data for the bar series.
- Minimal and default value is: -1 (count limited by the number of rows in the model)
+ The minimum and default value is -1 (number limited to the number of rows in the model).
*/
/*!
\qmlproperty int VBarModelMapper::rowCount
- Defines the number of rows of the model that are mapped as the data for QAbstractBarSeries. The default value is
- -1 (count limited by the number of rows in the model)
+ The number of rows of the model that are mapped as the data for the bar series. The default
+ value is -1 (number limited to the number of rows in the model).
*/
/*!
\fn void QVBarModelMapper::seriesReplaced()
- Emitted when the series to which mapper is connected to has changed.
+ This signal is emitted when the bar series that the mapper is connected to changes.
*/
/*!
\fn void QVBarModelMapper::modelReplaced()
- Emitted when the model to which mapper is connected to has changed.
+ This signal is emitted when the model that the mapper is connected to changes.
*/
/*!
\fn void QVBarModelMapper::firstBarSetColumnChanged()
- Emitted when the firstBarSetColumn has changed.
+ This signal is emitted when the first bar set column changes.
*/
/*!
\fn void QVBarModelMapper::lastBarSetColumnChanged()
- Emitted when the lastBarSetColumn has changed.
+ This signal is emitted when the last bar set column changes.
*/
/*!
\fn void QVBarModelMapper::firstRowChanged()
- Emitted when the firstRow has changed.
+ This signal is emitted when the first row changes.
*/
/*!
\fn void QVBarModelMapper::rowCountChanged()
- Emitted when the rowCount has changed.
+ This signal is emitted when the number of rows changes.
*/
/*!
- Constructs a mapper object which is a child of \a parent.
+ Constructs a mapper object that is a child of \a parent.
*/
QVBarModelMapper::QVBarModelMapper(QObject *parent) :
QBarModelMapper(parent)
diff --git a/src/charts/barchart/vertical/bar/qbarseries.cpp b/src/charts/barchart/vertical/bar/qbarseries.cpp
index 0c163ce5..03a04e98 100644
--- a/src/charts/barchart/vertical/bar/qbarseries.cpp
+++ b/src/charts/barchart/vertical/bar/qbarseries.cpp
@@ -40,11 +40,10 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QBarSeries
\inmodule Qt Charts
- \brief Series for creating bar chart.
+ \brief The QBarSeries class presents a series of data as vertical bars grouped by category.
- QBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as groups, where bars in same category are grouped next to each other. QBarSeries groups the data
- from sets to categories, which are defined by a QStringList.
+ This class draws data as a series of vertical bars grouped by category, with one bar per
+ category from each bar set added to the series.
See the \l {BarChart Example} {bar chart example} to learn how to create a grouped bar chart.
\image examples_barchart.png
@@ -58,9 +57,12 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series for creating bar chart.
+ \brief Presents a series of data as vertical bars grouped by category.
- The following QML shows how to create a simple grouped bar chart:
+ The data is drawn as a series of vertical bars grouped by category, with one bar per
+ category from each bar set added to the series.
+
+ The following QML code snippet shows how to create a simple grouped bar chart:
\snippet qmlchart/qml/qmlchart/View6.qml 1
\beginfloatleft
\image examples_qmlchart6.png
@@ -69,8 +71,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QBarSeries.
- QBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty bar series that is a QObject and a child of \a parent.
*/
QBarSeries::QBarSeries(QObject *parent)
: QAbstractBarSeries(*new QBarSeriesPrivate(this), parent)
@@ -79,7 +80,7 @@ QBarSeries::QBarSeries(QObject *parent)
}
/*!
- Returns QAbstractSeries::SeriesTypeBar.
+ Returns the bar series.
*/
QAbstractSeries::SeriesType QBarSeries::type() const
{
@@ -87,7 +88,7 @@ QAbstractSeries::SeriesType QBarSeries::type() const
}
/*!
- Destructor. Removes series from chart.
+ Removes the bar series from the chart.
*/
QBarSeries::~QBarSeries()
{
diff --git a/src/charts/barchart/vertical/percent/qpercentbarseries.cpp b/src/charts/barchart/vertical/percent/qpercentbarseries.cpp
index 63be6a74..c2e54b58 100644
--- a/src/charts/barchart/vertical/percent/qpercentbarseries.cpp
+++ b/src/charts/barchart/vertical/percent/qpercentbarseries.cpp
@@ -39,11 +39,13 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QPercentBarSeries
\inmodule Qt Charts
- \brief Series for creating percent bar chart.
+ \brief The QPercentBarSeries class presents a series of categorized data as
+ a percentage of each category.
- QPercentBarSeries represents a series of data shown as bars. The purpose of this class is to
- draw bars as stacks, where each bar is shown as percentage of all bars in that category.
- QPercentBarSeries groups the data from sets to categories, which are defined by a QStringList.
+ This class draws data as a series of uniformly sized vertically stacked bars, with one
+ bar per category. Each bar set added to the series contributes a single segment to each
+ stacked bar. The segment size corresponds to the percentage of the segment value compared
+ with the total value of all segments in the stack.
Bars with zero value are not drawn.
See the \l {PercentbarChart Example} {percent bar chart example} to learn how to create a
@@ -59,9 +61,15 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series for creating persent bar chart.
+ \brief Presents a series of categorized data as a percentage of each category.
- The following QML shows how to create a simple percent bar chart:
+ The data is drawn as a series of uniformly sized vertically stacked bars, with one
+ bar per category. Each bar set added to the series contributes a single segment to each
+ stacked bar. The segment size corresponds to the percentage of the segment value compared
+ with the total value of all segments in the stack.
+ Bars with zero value are not drawn.
+
+ The following QML code snippet shows how to create a simple percent bar chart:
\snippet qmlchart/qml/qmlchart/View8.qml 1
\beginfloatleft
\image examples_qmlchart8.png
@@ -70,8 +78,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QPercentBarSeries.
- QPercentBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty vertical percent bar series that is a QObject and a child of \a parent.
*/
QPercentBarSeries::QPercentBarSeries(QObject *parent)
: QAbstractBarSeries(*new QPercentBarSeriesPrivate(this), parent)
@@ -79,7 +86,7 @@ QPercentBarSeries::QPercentBarSeries(QObject *parent)
}
/*!
- Destructor. Removes series from chart.
+ Removes the bar series from the chart.
*/
QPercentBarSeries::~QPercentBarSeries()
{
@@ -89,7 +96,7 @@ QPercentBarSeries::~QPercentBarSeries()
}
/*!
- Returns QAbstractSeries::SeriesTypePercentBar.
+ Returns the vertical percent bar series.
*/
QAbstractSeries::SeriesType QPercentBarSeries::type() const
{
diff --git a/src/charts/barchart/vertical/stacked/qstackedbarseries.cpp b/src/charts/barchart/vertical/stacked/qstackedbarseries.cpp
index 7d4e2315..744617fd 100644
--- a/src/charts/barchart/vertical/stacked/qstackedbarseries.cpp
+++ b/src/charts/barchart/vertical/stacked/qstackedbarseries.cpp
@@ -39,11 +39,10 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QStackedBarSeries
\inmodule Qt Charts
- \brief Series for creating stacked bar chart.
+ \brief The QStackedBarSeries class presents a series of data as vertically stacked bars,
+ with one bar per category.
- QStackedBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as stacks, where bars in same category are stacked on top of each other.
- QStackedBarSeries groups the data from sets to categories, which are defined by QStringList.
+ Each bar set added to the series contributes a single segment to each stacked bar.
See the \l {StackedbarChart Example} {stacked bar chart example} to learn how to create a stacked bar chart.
\image examples_stackedbarchart.png
@@ -58,7 +57,9 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractBarSeries
- \brief Series for creating stacked bar chart.
+ \brief Presents a series of data as vertically stacked bars, with one bar per category.
+
+ Each bar set added to the series contributes a single segment to each stacked bar.
The following QML shows how to create a simple stacked bar chart:
\snippet qmlchart/qml/qmlchart/View7.qml 1
@@ -69,8 +70,7 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
- Constructs empty QStackedBarSeries.
- QStackedBarSeries is QObject which is a child of a \a parent.
+ Constructs an empty bar series that is a QObject and a child of \a parent.
*/
QStackedBarSeries::QStackedBarSeries(QObject *parent)
: QAbstractBarSeries(*new QStackedBarSeriesPrivate(this), parent)
@@ -78,7 +78,7 @@ QStackedBarSeries::QStackedBarSeries(QObject *parent)
}
/*!
- Destructor. Removes series from chart.
+ Removes the bar series from the chart.
*/
QStackedBarSeries::~QStackedBarSeries()
{
@@ -87,7 +87,7 @@ QStackedBarSeries::~QStackedBarSeries()
d->m_chart->removeSeries(this);
}
/*!
- Returns QAbstractSeries::SeriesTypeStackedBar.
+ Returns the stacked bar series.
*/
QAbstractSeries::SeriesType QStackedBarSeries::type() const
{
diff --git a/src/charts/boxplotchart/qboxplotseries.cpp b/src/charts/boxplotchart/qboxplotseries.cpp
index 26184735..221b940d 100644
--- a/src/charts/boxplotchart/qboxplotseries.cpp
+++ b/src/charts/boxplotchart/qboxplotseries.cpp
@@ -46,16 +46,14 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QBoxPlotSeries
\inmodule Qt Charts
- \brief Series for creating box-and-whiskers chart.
+ \brief The QBoxPlotSeries class presents data in box-and-whiskers charts.
- QBoxPlotSeries represents a series of data shown as box-and-whisker bars. The purpose of this
- class is to act as a container for single box-and-whisker items. Each item is drawn to own slot.
- If chart includes multiple instances of QBoxPlotSeries then box-and-whiskers items with the same
- index are drawn to same slot.
+ A box plot series acts as a container for box-and-whiskers items. Items from multiple series
+ are grouped into categories according to their index value.
- \note The slot, each item in QBoxPlotSeries is drawn, represents a category in QBarCategoryAxis.
- The category labels have to be unique. If same category label is defined for several
- box-and-whisker items only the first one is drawn.
+ The QBarCategoryAxis class is used to add the categories to the chart's axis. Category labels
+ have to be unique. If the same category label is defined for several box-and-whiskers items,
+ only the first one is drawn.
See the \l {Box and Whiskers Example} {box-and-whiskers chart example} to learn how to create a
box-and-whiskers chart.
@@ -65,91 +63,94 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\fn QBoxPlotSeries::boxsetsAdded(QList<QBoxSet *> sets)
- \brief Signal is emitted when a new \a sets of box-and-whiskers data is added to the series.
+ This signal is emitted when the list of box-and-whiskers items specified by \a sets
+ is added to the series.
*/
/*!
\fn QBoxPlotSeries::boxsetsRemoved(QList<QBoxSet *> sets)
- \brief Signal is emitted when \a sets of box-and-whiskers data is removed from the series.
+ This signal is emitted when the list of box-and-whiskers items specified by \a sets
+ is removed from the series.
*/
/*!
\fn QBoxPlotSeries::clicked(QBoxSet *boxset)
- \brief Signal is emitted when the user clicks the \a boxset on the chart.
+ This signal is emitted when the user clicks the box-and-whiskers item specified by
+ \a boxset in the chart.
*/
/*!
\fn QBoxPlotSeries::pressed(QBoxSet *boxset)
- \brief Signal is emitted when the user presses the \a boxset on the chart.
+ This signal is emitted when the user clicks the box-and-whiskers item specified by
+ \a boxset in the chart and holds down the mouse button.
*/
/*!
\fn QBoxPlotSeries::released(QBoxSet *boxset)
- \brief Signal is emitted when the user releases the \a boxset on the chart.
+ This signal is emitted when the user releases the mouse press on the box-and-whiskers
+ item specified by \a boxset in the chart.
*/
/*!
\fn QBoxPlotSeries::doubleClicked(QBoxSet *boxset)
- \brief Signal is emitted when the user doubleclicks the \a boxset on the chart.
+ This signal is emitted when the user double-clicks the box-and-whiskers item specified by
+ \a boxset in the chart.
*/
/*!
\fn QBoxPlotSeries::hovered(bool status, QBoxSet *boxset)
- \brief Signal is emitted when there is change in hover \a status over \a boxset.
+ This signal is emitted when a mouse is hovered over the box-and-whiskers item specified by
+ \a boxset in the chart. When the mouse moves over the item, \a status turns \c true, and
+ when the mouse moves away again, it turns \c false.
*/
/*!
\fn QBoxPlotSeries::countChanged()
- \brief Signal is emitted when there is change in count of box-and-whiskers items in the series.
+ This signal is emitted when the number of box-and-whiskers items in the series changes.
*/
/*!
\property QBoxPlotSeries::boxOutlineVisible
- \brief This property configures the visibility of the middle box outline.
+ \brief The visibility of the box outline.
*/
/*!
\property QBoxPlotSeries::boxWidth
- \brief This property configures the width of the box-and-whiskers item. The value signifies the relative
- width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values
- are clamped to 0.0 and values over 1.0 are clamped to 1.0.
+ \brief The width of the box-and-whiskers item. The value indicates the relative
+ width of the item within its category. The value can be between 0.0 and 1.0. Negative values
+ are replaced with 0.0 and values greater than 1.0 are replaced with 1.0.
*/
/*!
\property QBoxPlotSeries::pen
- \brief This property configures the pen of the box-and-whiskers items.
+ \brief The pen used to draw the lines of the box-and-whiskers items.
*/
/*!
\property QBoxPlotSeries::brush
- \brief This property configures the brush of the box-and-whiskers items.
+ \brief The brush used to fill the boxes of the box-and-whiskers items.
*/
/*!
\property QBoxPlotSeries::count
- \brief The count of sets in series.
-*/
-
-/*!
- \qmlproperty QString BoxPlotSeries::brushFilename
- The name of the file used as a brush for the series.
+ \brief The number of box-and-whiskers items in a box plot series.
*/
/*!
\fn void QBoxPlotSeries::boxOutlineVisibilityChanged()
- Signal is emitted when the middle box outline visibility is changed.
+ This signal is emitted when the box outline visibility changes.
*/
+
/*!
\fn void QBoxPlotSeries::boxWidthChanged()
- Signal is emitted when the width of the box-and-whiskers item is changed.
+ This signal is emitted when the width of the box-and-whiskers item changes.
*/
/*!
\fn void QBoxPlotSeries::penChanged()
- This signal is emitted when the pen of the box-and-whiskers has changed.
- \sa brush
+ This signal is emitted when the pen used to draw the lines of the box-and-whiskers
+ items changes.
*/
/*!
\fn void QBoxPlotSeries::brushChanged()
- This signal is emitted when the brush of the box-and-whiskers has changed.
- \sa brush
+ This signal is emitted when the brush used to fill the boxes of the box-and-whiskers
+ items changes.
*/
/*!
\fn virtual SeriesType QBoxPlotSeries::type() const
- \brief Returns type of series.
+ Returns the type of the series.
\sa QAbstractSeries, SeriesType
*/
/*!
- Constructs empty QBoxPlotSeries.
- QBoxPlotSeries is QObject which is a child of a \a parent.
+ Constructs an empty box plot series that is a QObject and a child of \a parent.
*/
QBoxPlotSeries::QBoxPlotSeries(QObject *parent)
: QAbstractSeries(*new QBoxPlotSeriesPrivate(this), parent)
@@ -157,7 +158,7 @@ QBoxPlotSeries::QBoxPlotSeries(QObject *parent)
}
/*!
- Destructor. Removes series from chart.
+ Removes the series from the chart.
*/
QBoxPlotSeries::~QBoxPlotSeries()
{
@@ -167,8 +168,9 @@ QBoxPlotSeries::~QBoxPlotSeries()
}
/*!
- Adds a single box and whiskers set to series. Takes ownership of the \a set. If the set is null or is already in series, it won't be appended.
- Returns true, if appending succeeded.
+ Adds a single box-and-whiskers item specified by \a set to the series and takes ownership of
+ it. If the item is null or it already belongs to the series, it will not be appended.
+ Returns \c true if appending succeeded.
*/
bool QBoxPlotSeries::append(QBoxSet *set)
{
@@ -186,7 +188,8 @@ bool QBoxPlotSeries::append(QBoxSet *set)
}
/*!
- Removes boxset from the series. Deletes the \a set and returns true if successful.
+ Removes the box-and-whiskers item specified by \a set from the series and permanently
+ deletes it if the removal succeeds. Returns \c true if the item was removed.
*/
bool QBoxPlotSeries::remove(QBoxSet *set)
{
@@ -205,12 +208,14 @@ bool QBoxPlotSeries::remove(QBoxSet *set)
}
/*!
- Takes a single \a set from the series. Does not delete the boxset object.
+ Takes the box-and-whiskers item specified by \a set from the series. Does not delete the
+ item.
+
+ \note The series remains the item's parent object. You must set the parent object to take
+ full ownership.
- NOTE: The series remains as the boxset's parent object. You must set the
- parent object to take full ownership.
+ Returns \c true if the take operation succeeds.
- Returns true if take was successful.
*/
bool QBoxPlotSeries::take(QBoxSet *set)
{
@@ -227,10 +232,9 @@ bool QBoxPlotSeries::take(QBoxSet *set)
}
/*!
- Adds a list of boxsets to series. Takes ownership of the \a sets.
- Returns true, if all sets were appended successfully. If any of the sets is null or is already appended to series,
- nothing is appended and function returns false. If any of the sets is in list more than once, nothing is appended
- and function returns false.
+ Adds a list of box-and-whiskers items specified by \a sets to the series and takes ownership of
+ them. If the list is null or the items already belong to the series, it will not be appended.
+ Returns \c true if appending succeeded.
*/
bool QBoxPlotSeries::append(QList<QBoxSet *> sets)
{
@@ -244,9 +248,9 @@ bool QBoxPlotSeries::append(QList<QBoxSet *> sets)
}
/*!
- Insert a box-and-whiskers set to the series at \a index postion. Takes ownership of the \a set. If the set is null or
- is already in series, it won't be appended. Returns true, if inserting succeeded.
-
+ Inserts a box-and-whiskers item specified by \a set to a series at the position specified by
+ \a index and takes ownership of the item. If the item is null or already belongs to the series,
+ it will not be appended. Returns \c true if inserting succeeds.
*/
bool QBoxPlotSeries::insert(int index, QBoxSet *set)
{
@@ -262,7 +266,7 @@ bool QBoxPlotSeries::insert(int index, QBoxSet *set)
}
/*!
- Removes all boxsets from the series. Deletes removed sets.
+ Removes all box-and-whiskers items from the series and permanently deletes them.
*/
void QBoxPlotSeries::clear()
{
@@ -278,7 +282,7 @@ void QBoxPlotSeries::clear()
}
/*!
- Returns number of sets in series.
+ Returns the number of box-and-whiskers items in a box plot series.
*/
int QBoxPlotSeries::count() const
{
@@ -287,7 +291,7 @@ int QBoxPlotSeries::count() const
}
/*!
- Returns a list of sets in series. Keeps ownership of sets.
+ Returns a list of box-and-whiskers items in a box plot series. Keeps the ownership of the items.
*/
QList<QBoxSet *> QBoxPlotSeries::boxSets() const
{
diff --git a/src/charts/boxplotchart/qboxset.cpp b/src/charts/boxplotchart/qboxset.cpp
index a92c8a19..59adc78d 100644
--- a/src/charts/boxplotchart/qboxset.cpp
+++ b/src/charts/boxplotchart/qboxset.cpp
@@ -36,93 +36,103 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QBoxSet
\inmodule Qt Charts
- \brief Building block for box-and-whiskers chart.
+ \brief The QBoxSet class represents one item in a box-and-whiskers chart.
- QBoxSet represents one box-and-whiskers item. It takes five values to create a graphical representation
- of range and three medians. There are two ways to give the values. The first one is with constructor
- or stream operator (<<). The values have to be given in the following order: lower extreme,
- lower quartile, median, upper quartile and upper extreme. The Second method is to create an empty QBoxSet instance and
- give the values using setValue method.
+ A box-and-whiskers item is a graphical representation of a range and three median values
+ that is constructed from five different values. There are two ways to specify the values.
+ The first one is by using a constructor or stream operator (<<). The values have to be
+ specified in the following order: lower extreme, lower quartile, median, upper quartile,
+ and upper extreme.
+
+ The second way is to create an empty QBoxSet instance and specify the values using the
+ setValue() method.
+
+ See the \l{Box and Whiskers Example}{box-and-whiskers chart example} to learn how to
+ create a box-and-whiskers chart.
\sa QBoxPlotSeries
*/
/*!
\enum QBoxSet::ValuePositions
- \value LowerExtreme
- \value LowerQuartile
- \value Median
- \value UpperQuartile
- \value UpperExtreme
+ This enum type defines the values of a box-and-whiskers item:
+
+ \value LowerExtreme The smallest value of the box-and-whiskers item.
+ \value LowerQuartile The median value of the lower half of the box-and-whiskers item.
+ \value Median The median value of the box-and-whiskers item.
+ \value UpperQuartile The median value of the upper half of the box-and-whiskers item.
+ \value UpperExtreme The largest value of the box-and-whiskers item.
*/
/*!
\property QBoxSet::pen
- \brief Defines the pen used by the box-and-whiskers set.
+ \brief The pen used to draw the lines of the box-and-whiskers item.
*/
/*!
\property QBoxSet::brush
- \brief Defines the brush used by the box-and-whiskers set.
+ \brief The brush used fill the box of the box-and-whiskers item.
*/
/*!
\qmlproperty QString BoxSet::brushFilename
- The name of the file used as a brush for the box-and-whiskers set.
+ The name of the file used as a brush for the box-and-whiskers item.
*/
/*!
\fn void QBoxSet::clicked()
- The signal is emitted if the user clicks with a mouse on top of box-and-whisker item.
+ This signal is emitted when the user clicks a box-and-whiskers item in the chart.
*/
/*!
\fn void QBoxSet::pressed()
- The signal is emitted if the user presses with a mouse on top of box-and-whisker item.
+ This signal is emitted when the user clicks a box-and-whiskers item in the chart
+ and holds down the mouse button.
*/
/*!
\fn void QBoxSet::released()
- The signal is emitted if the user releases with a mouse on top of box-and-whisker item.
+ This signal is emitted when the user releases the mouse press on a box-and-whiskers item.
*/
/*!
\fn void QBoxSet::doubleClicked()
- The signal is emitted if the user doubleclicks with a mouse on top of box-and-whisker item.
+ This signal is emitted when the user double-clicks a box-and-whiskers item.
*/
/*!
\fn void QBoxSet::hovered(bool status)
- The signal is emitted if mouse is hovered on top of box-and-whisker item.
- Parameter \a status is true, if mouse entered on top of item, false if mouse left from top of item.
+ This signal is emitted when a mouse is hovered over a box-and-whiskers item in a chart.
+ When the mouse moves over the item, \a status turns \c true, and when the mouse moves
+ away again, it turns \c false.
*/
/*!
\fn void QBoxSet::penChanged()
- This signal is emitted when the pen of the box-and-whisker item has changed.
+ This signal is emitted when the pen of the box-and-whiskers item changes.
\sa pen
*/
/*!
\fn void QBoxSet::brushChanged()
- This signal is emitted when the brush of the box-and-whisker item has changed.
+ This signal is emitted when the brush of the box-and-whiskers item changes.
\sa brush
*/
/*!
\fn void QBoxSet::valuesChanged()
- This signal is emitted when multiple values have been changed on the box-and-whisker item.
+ This signal is emitted when multiple values of the box-and-whiskers item change.
\sa append()
*/
/*!
\fn void QBoxSet::valueChanged(int index)
- This signal is emitted values the value in the box-and-whisker item has been modified.
- Parameter \a index indicates the position of the modified value.
+ This signal is emitted when the value of the box-and-whiskers item specified by
+ \a index is modified.
\sa at()
*/
/*!
\fn void QBoxSet::cleared()
- This signal is emitted when all the values on the set are cleared to 0.
+ This signal is emitted when all the values of the box-and-whiskers item are set to 0.
*/
/*!
- Constructs QBoxSet with optional \a label and parent of \a parent
+ Constructs a box-and-whiskers item with the optional label \a label and parent \a parent.
*/
QBoxSet::QBoxSet(const QString label, QObject *parent)
: QObject(parent),
@@ -131,8 +141,9 @@ QBoxSet::QBoxSet(const QString label, QObject *parent)
}
/*!
- Constructs QBoxSet with given ordered values. \a le for lower extreme, \a lq for lower quartile, \a m for median,
- \a uq for upper quartile and \a ue for upper quartile. \a label and \a parent are optional.
+ Constructs a box-and-whiskers item with the following ordered values: \a le specifies the
+ lower extreme, \a lq the lower quartile, \a m the median, \a uq the upper quartile, and
+ \a ue the upper quartile. Optionally, the \a label and \a parent can be specified.
*/
QBoxSet::QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label, QObject *parent)
: QObject(parent),
@@ -146,14 +157,14 @@ QBoxSet::QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq,
}
/*!
- Destroys the boxset
+ Destroys the a box-and-whiskers item.
*/
QBoxSet::~QBoxSet()
{
}
/*!
- Appends new value \a value to the end of set.
+ Appends the new value specified by \a value to the end of the box-and-whiskers item.
*/
void QBoxSet::append(const qreal value)
{
@@ -162,8 +173,7 @@ void QBoxSet::append(const qreal value)
}
/*!
- Appends a list of reals to set. Works like append with single real value. The \a values in list
- are appended to end of boxset.
+ Appends a list of real values specified by \a values to the end of the box-and-whiskers item.
\sa append()
*/
void QBoxSet::append(const QList<qreal> &values)
@@ -173,7 +183,7 @@ void QBoxSet::append(const QList<qreal> &values)
}
/*!
- Sets new \a label for the category of the set.
+ Sets the label specified by \a label for the category of the box-and-whiskers item.
*/
void QBoxSet::setLabel(const QString label)
{
@@ -181,7 +191,7 @@ void QBoxSet::setLabel(const QString label)
}
/*!
- Returns the label of the the category of the set.
+ Returns the label of the category of the box-and-whiskers item.
*/
QString QBoxSet::label() const
{
@@ -189,7 +199,8 @@ QString QBoxSet::label() const
}
/*!
- Convenience operator. Same as append, with real \a value.
+ A convenience operator for appending the real value specified by \a value to the end
+ of the box-and-whiskers item.
\sa append()
*/
QBoxSet &QBoxSet::operator << (const qreal &value)
@@ -199,7 +210,8 @@ QBoxSet &QBoxSet::operator << (const qreal &value)
}
/*!
- Sets a new \a value on the \a index position. For \a index ValuePositions can be used.
+ Sets the value specified by \a value in the position specified by \a index.
+ The index can be specified by using the ValuePositions enumeration values.
*/
void QBoxSet::setValue(const int index, const qreal value)
{
@@ -208,7 +220,7 @@ void QBoxSet::setValue(const int index, const qreal value)
}
/*!
- Sets all values on the set to 0.
+ Sets all the values of the box-and-whiskers item to 0.
*/
void QBoxSet::clear()
{
@@ -217,8 +229,9 @@ void QBoxSet::clear()
}
/*!
- Returns value of set indexed by \a index. For \a index ValuePositions can be used.
- If the index is out of bounds 0.0 is returned.
+ Returns the value of the box-and-whiskers item specified by \a index.
+ The index can be specified by using ValuePositions enumeration values.
+ If the index is out of bounds, 0.0 is returned.
*/
qreal QBoxSet::at(const int index) const
{
@@ -228,8 +241,9 @@ qreal QBoxSet::at(const int index) const
}
/*!
- Returns value of set indexed by \a index. For \a index ValuePositions can be used.
- If the index is out of bounds 0.0 is returned.
+ Returns the value of the box-and-whiskers item specified by \a index.
+ The index can be specified by using ValuePositions enumeration values.
+ If the index is out of bounds, 0.0 is returned.
*/
qreal QBoxSet::operator [](const int index) const
{
@@ -237,7 +251,7 @@ qreal QBoxSet::operator [](const int index) const
}
/*!
- Returns count of values appended to the set.
+ Returns the number of values appended to the box-and-whiskers item.
*/
int QBoxSet::count() const
{
@@ -245,7 +259,7 @@ int QBoxSet::count() const
}
/*!
- Sets pen for set. Boxes of this set are drawn using \a pen
+ Sets the pen used to draw the box-and-whiskers item to \a pen.
*/
void QBoxSet::setPen(const QPen &pen)
{
@@ -257,7 +271,7 @@ void QBoxSet::setPen(const QPen &pen)
}
/*!
- Returns pen of the set.
+ Returns the pen used to draw the box-and-whiskers item.
*/
QPen QBoxSet::pen() const
{
@@ -265,7 +279,7 @@ QPen QBoxSet::pen() const
}
/*!
- Sets brush for the set. Boxes of this set are drawn using \a brush
+ Sets the brush used to fill the box-and-whiskers item to \a brush.
*/
void QBoxSet::setBrush(const QBrush &brush)
{
@@ -277,7 +291,7 @@ void QBoxSet::setBrush(const QBrush &brush)
}
/*!
- Returns brush of the set.
+ Returns the brush used to fill the box-and-whiskers item.
*/
QBrush QBoxSet::brush() const
{
diff --git a/src/charts/candlestickchart/qcandlestickset.cpp b/src/charts/candlestickchart/qcandlestickset.cpp
index 99779ef7..f9a5e5d2 100644
--- a/src/charts/candlestickchart/qcandlestickset.cpp
+++ b/src/charts/candlestickchart/qcandlestickset.cpp
@@ -470,7 +470,7 @@ QCandlestickSetPrivate::~QCandlestickSetPrivate()
bool QCandlestickSetPrivate::setTimestamp(qreal timestamp)
{
- timestamp = qMax(timestamp, 0.0);
+ timestamp = qMax(timestamp, qreal(0.0));
timestamp = qRound64(timestamp);
if (m_timestamp == timestamp)
diff --git a/src/charts/chartitem.cpp b/src/charts/chartitem.cpp
index fda019c9..fd6e8610 100644
--- a/src/charts/chartitem.cpp
+++ b/src/charts/chartitem.cpp
@@ -47,6 +47,11 @@ AbstractDomain* ChartItem::domain() const
return m_series->domain();
}
+void ChartItem::cleanup()
+{
+ disconnect();
+}
+
void ChartItem::handleDomainUpdated()
{
qWarning() << __FUNCTION__<< "Slot not implemented";
diff --git a/src/charts/chartitem_p.h b/src/charts/chartitem_p.h
index ad4266d3..b6b30118 100644
--- a/src/charts/chartitem_p.h
+++ b/src/charts/chartitem_p.h
@@ -52,6 +52,8 @@ class ChartItem : public ChartElement
public:
ChartItem(QAbstractSeriesPrivate *series,QGraphicsItem* item);
AbstractDomain* domain() const;
+ virtual void cleanup();
+
public Q_SLOTS:
virtual void handleDomainUpdated();
diff --git a/src/charts/chartpresenter.cpp b/src/charts/chartpresenter.cpp
index a4955141..4ba3e13d 100644
--- a/src/charts/chartpresenter.cpp
+++ b/src/charts/chartpresenter.cpp
@@ -146,7 +146,7 @@ void ChartPresenter::handleSeriesRemoved(QAbstractSeries *series)
{
ChartItem *chart = series->d_ptr->m_item.take();
chart->hide();
- chart->disconnect();
+ chart->cleanup();
series->disconnect(chart);
chart->deleteLater();
if (chart->animation())
diff --git a/src/charts/doc/src/examples-areachart.qdoc b/src/charts/doc/src/examples-areachart.qdoc
index f5c75274..4a2ee63d 100644
--- a/src/charts/doc/src/examples-areachart.qdoc
+++ b/src/charts/doc/src/examples-areachart.qdoc
@@ -36,6 +36,10 @@
\image examples_areachart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Area Charts
+
To create area charts, we need two QLineSeries instances. They are going to define the upper and lower boundary of the area.
\snippet areachart/main.cpp 1
diff --git a/src/charts/doc/src/examples-audio.qdoc b/src/charts/doc/src/examples-audio.qdoc
index f4bea6d7..3efcbd07 100644
--- a/src/charts/doc/src/examples-audio.qdoc
+++ b/src/charts/doc/src/examples-audio.qdoc
@@ -34,4 +34,6 @@
\brief This example shows the drawing of dynamic data (microphone input).
\image examples_audio.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-barchart.qdoc b/src/charts/doc/src/examples-barchart.qdoc
index ee35f7e8..85c37369 100644
--- a/src/charts/doc/src/examples-barchart.qdoc
+++ b/src/charts/doc/src/examples-barchart.qdoc
@@ -38,6 +38,10 @@
\image examples_barchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Bar Charts
+
The barsets are used in the same way in all barcharts.
To illustrate the difference between various barcharts, we use the same data in the examples.
Data that the barchart visualizes, is defined by the QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-barmodelmapper.qdoc b/src/charts/doc/src/examples-barmodelmapper.qdoc
index d5259d40..0e0e4fd9 100644
--- a/src/charts/doc/src/examples-barmodelmapper.qdoc
+++ b/src/charts/doc/src/examples-barmodelmapper.qdoc
@@ -37,6 +37,10 @@
\image examples_barmodelmapper.png
+ \include examples-run.qdocinc
+
+ \section1 Using Data Models with Bar Charts
+
Let's start by creating an instance of CustomTableModel class.
The CustomTableModel class is derived from QAbstractTableModel, and it was created for the purpose of this example.
The constructor of this class populates the model's internal data store with the data required for our chart example.
diff --git a/src/charts/doc/src/examples-boxplotchart.qdoc b/src/charts/doc/src/examples-boxplotchart.qdoc
index d85ca018..f483195d 100644
--- a/src/charts/doc/src/examples-boxplotchart.qdoc
+++ b/src/charts/doc/src/examples-boxplotchart.qdoc
@@ -39,6 +39,10 @@
\image examples_boxplotchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Box-and-Whiskers Charts
+
To show the share deviation of two companies we start by creating two QBoxPlotSeries to handle monthly data.
\snippet boxplotchart/main.cpp 1
diff --git a/src/charts/doc/src/examples-callout.qdoc b/src/charts/doc/src/examples-callout.qdoc
index cc2adfd5..6c080541 100644
--- a/src/charts/doc/src/examples-callout.qdoc
+++ b/src/charts/doc/src/examples-callout.qdoc
@@ -41,4 +41,6 @@
QPointF QChart::mapToPosition(const QPointF &value, QAbstractSeries *series)
QPointF QChart::mapToValue(const QPointF &position, QAbstractSeries *series)
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-candlestickchart.qdoc b/src/charts/doc/src/examples-candlestickchart.qdoc
index 2d4d63bc..ecbe50f7 100644
--- a/src/charts/doc/src/examples-candlestickchart.qdoc
+++ b/src/charts/doc/src/examples-candlestickchart.qdoc
@@ -36,6 +36,10 @@
\image examples_candlestickchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Candlestick Charts
+
To display a candlestick chart, we start by creating QCandlestickSeries to handle daily data. We
are also specifying custom increasing and decreasing body colors.
diff --git a/src/charts/doc/src/examples-chartthemes.qdoc b/src/charts/doc/src/examples-chartthemes.qdoc
index 06797bd1..bc9612bb 100644
--- a/src/charts/doc/src/examples-chartthemes.qdoc
+++ b/src/charts/doc/src/examples-chartthemes.qdoc
@@ -41,4 +41,6 @@
\image examples_chartthemes_light.png
\image examples_chartthemes_brown_sand.png
\image examples_chartthemes_blue_cerulean.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-customchart.qdoc b/src/charts/doc/src/examples-customchart.qdoc
index 889ee588..2fd8f8fe 100644
--- a/src/charts/doc/src/examples-customchart.qdoc
+++ b/src/charts/doc/src/examples-customchart.qdoc
@@ -35,6 +35,10 @@
\brief This example shows how to customize the appearance of the different elements on a chart.
\image examples_customchart.png
+ \include examples-run.qdocinc
+
+ \section1 Customizing Charts
+
We begin by creating a simple line series and a chart object.
\snippet customchart/main.cpp 1
diff --git a/src/charts/doc/src/examples-datetimeaxis.qdoc b/src/charts/doc/src/examples-datetimeaxis.qdoc
index bd0452a0..ada3aea8 100644
--- a/src/charts/doc/src/examples-datetimeaxis.qdoc
+++ b/src/charts/doc/src/examples-datetimeaxis.qdoc
@@ -36,6 +36,10 @@
\image examples_datetimeaxis.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Line Charts
+
To create line chart, QLineSeries instance is needed. Let's create one.
\snippet datetimeaxis/main.cpp 1
diff --git a/src/charts/doc/src/examples-donutbreakdown.qdoc b/src/charts/doc/src/examples-donutbreakdown.qdoc
index 39c04eca..eae6417f 100644
--- a/src/charts/doc/src/examples-donutbreakdown.qdoc
+++ b/src/charts/doc/src/examples-donutbreakdown.qdoc
@@ -35,6 +35,10 @@
\brief This example shows how to use create a donut breakdown chart using QPieSeries API.
\image examples_donutbreakdown.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Donut Breakdown Charts
+
Let's start by defining some data for the chart.
\snippet donutbreakdown/main.cpp 1
diff --git a/src/charts/doc/src/examples-donutchart.qdoc b/src/charts/doc/src/examples-donutchart.qdoc
index e6e476d7..1b784a14 100644
--- a/src/charts/doc/src/examples-donutchart.qdoc
+++ b/src/charts/doc/src/examples-donutchart.qdoc
@@ -35,4 +35,6 @@
\brief This example shows how to create a simple donut chart, and do some customizations to
a slice.
\image examples_donutchart.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-dynamicspline.qdoc b/src/charts/doc/src/examples-dynamicspline.qdoc
index b701e64e..7db0559f 100644
--- a/src/charts/doc/src/examples-dynamicspline.qdoc
+++ b/src/charts/doc/src/examples-dynamicspline.qdoc
@@ -36,4 +36,6 @@
\image examples_dynamicspline1.png
\image examples_dynamicspline2.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-horizontalbarchart.qdoc b/src/charts/doc/src/examples-horizontalbarchart.qdoc
index 1b26c160..9dba96a4 100644
--- a/src/charts/doc/src/examples-horizontalbarchart.qdoc
+++ b/src/charts/doc/src/examples-horizontalbarchart.qdoc
@@ -39,6 +39,10 @@
\image examples_horizontalbarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Horizontal Bar Charts
+
The bar sets are used in the same way in all bar charts.
To illustrate the difference between various bar charts, we use the same data in all examples.
Data that bar chart visualizes, is defined by QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-horizontalpercentbarchart.qdoc b/src/charts/doc/src/examples-horizontalpercentbarchart.qdoc
index f941d296..63576029 100644
--- a/src/charts/doc/src/examples-horizontalpercentbarchart.qdoc
+++ b/src/charts/doc/src/examples-horizontalpercentbarchart.qdoc
@@ -44,6 +44,10 @@
\image examples_horizontalpercentbarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Horizontal Percent Bar Charts
+
The barsets are used in same way in all barcharts.
To illustrate the difference between various barcharts, we use same data in examples.
The data which the bar chart visualizes is defined by QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-horizontalstackedbarchart.qdoc b/src/charts/doc/src/examples-horizontalstackedbarchart.qdoc
index 85ad15e1..62430299 100644
--- a/src/charts/doc/src/examples-horizontalstackedbarchart.qdoc
+++ b/src/charts/doc/src/examples-horizontalstackedbarchart.qdoc
@@ -41,6 +41,10 @@
\image examples_horizontalstackedbarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Horizontal Stacked Bar Charts
+
The bar sets are used in same way in all bar charts.
To illustrate the difference between various barcharts, we use the same data in all examples.
The data that barchart visualizes, is defined by the QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-legend.qdoc b/src/charts/doc/src/examples-legend.qdoc
index acabdb0a..9649ddf6 100644
--- a/src/charts/doc/src/examples-legend.qdoc
+++ b/src/charts/doc/src/examples-legend.qdoc
@@ -48,6 +48,10 @@
\image examples_legend_detach.png
\image examples_legend_detach2.png
+ \include examples-run.qdocinc
+
+ \section1 Detaching and Attaching Legends
+
Here we turn the legend visible and set its alignment to the bottom of the chart.
\snippet legend/mainwidget.cpp 1
diff --git a/src/charts/doc/src/examples-legendmarkers.qdoc b/src/charts/doc/src/examples-legendmarkers.qdoc
index dc77f315..e2f04fd6 100644
--- a/src/charts/doc/src/examples-legendmarkers.qdoc
+++ b/src/charts/doc/src/examples-legendmarkers.qdoc
@@ -39,6 +39,10 @@
\image examples_legendmarkers.png
+ \include examples-run.qdocinc
+
+ \section1 Using Legend Markers
+
Our application has buttons for adding or removing a series in a chart and a button to connect or disconnect the legend markers clicked signal to our handler.
In the image above we have connected the markers and clicked on one of them.
diff --git a/src/charts/doc/src/examples-lineandbarchart.qdoc b/src/charts/doc/src/examples-lineandbarchart.qdoc
index e632858e..287e857f 100644
--- a/src/charts/doc/src/examples-lineandbarchart.qdoc
+++ b/src/charts/doc/src/examples-lineandbarchart.qdoc
@@ -39,6 +39,10 @@
\image examples_lineandbar.png
+ \include examples-run.qdocinc
+
+ \section1 Combining Charts
+
Here we create data for our bar series.
\snippet lineandbar/main.cpp 1
diff --git a/src/charts/doc/src/examples-linechart.qdoc b/src/charts/doc/src/examples-linechart.qdoc
index 8c478363..0eaf70ad 100644
--- a/src/charts/doc/src/examples-linechart.qdoc
+++ b/src/charts/doc/src/examples-linechart.qdoc
@@ -36,6 +36,10 @@
\image examples_linechart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Line Charts
+
To create a line chart, a QLineSeries instance is needed. Let's create one.
\snippet linechart/main.cpp 1
diff --git a/src/charts/doc/src/examples-logvalueaxis.qdoc b/src/charts/doc/src/examples-logvalueaxis.qdoc
index 9e9d210b..3e7d1a43 100644
--- a/src/charts/doc/src/examples-logvalueaxis.qdoc
+++ b/src/charts/doc/src/examples-logvalueaxis.qdoc
@@ -36,6 +36,10 @@
\image examples_logvalueaxis.png
+ \include examples-run.qdocinc
+
+ \section1 Using Logarithmic Value Axes
+
Create a QLineSeries instance and add some data to it.
\snippet logvalueaxis/main.cpp 1
diff --git a/src/charts/doc/src/examples-modeldata.qdoc b/src/charts/doc/src/examples-modeldata.qdoc
index 957a3847..18e4512e 100644
--- a/src/charts/doc/src/examples-modeldata.qdoc
+++ b/src/charts/doc/src/examples-modeldata.qdoc
@@ -37,6 +37,10 @@
\image examples_modeldata.png
+ \include examples-run.qdocinc
+
+ \section1 Using Model Data
+
Let's start by creating an instance of the CustomTableModel class.
The CustomTableModel class is derived from QAbstractTableModel and it was created for the purpose of this example.
The constructor of this class populates the internal data store of the model with the data that is suitable for our chart example.
diff --git a/src/charts/doc/src/examples-multiaxis.qdoc b/src/charts/doc/src/examples-multiaxis.qdoc
index 1c55396c..5289e96a 100644
--- a/src/charts/doc/src/examples-multiaxis.qdoc
+++ b/src/charts/doc/src/examples-multiaxis.qdoc
@@ -37,6 +37,10 @@
\image examples_multiaxis.png
+ \include examples-run.qdocinc
+
+ \section1 Using Multiple Axes
+
Create the QChart instance, hide the legend of the chart, and set its title.
\snippet multiaxis/main.cpp 1
diff --git a/src/charts/doc/src/examples-nesteddonuts.qdoc b/src/charts/doc/src/examples-nesteddonuts.qdoc
index a1f48193..168b7c71 100644
--- a/src/charts/doc/src/examples-nesteddonuts.qdoc
+++ b/src/charts/doc/src/examples-nesteddonuts.qdoc
@@ -35,6 +35,10 @@
\brief This example shows how to create a nested donuts chart using the QPieSeries API.
\image examples_nesteddonuts.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Nested Donut Charts
+
Let's start by creating a QChartView instance and enabling the Antialiasing on it. A QChart object is then obtained from the QChartView instance.
The legend is disabled and the title of the chart is set. Last line enables the animations of the chart.
diff --git a/src/charts/doc/src/examples-openglseries.qdoc b/src/charts/doc/src/examples-openglseries.qdoc
index 9b48056a..575418ca 100644
--- a/src/charts/doc/src/examples-openglseries.qdoc
+++ b/src/charts/doc/src/examples-openglseries.qdoc
@@ -36,6 +36,10 @@
\image examples_openglseries.png
+ \include examples-run.qdocinc
+
+ \section1 Enabling OpenGL Acceleration
+
To create an OpenGL accelerated series, all you have to do compared to a regular
series is to set QAbstractSeries::useOpenGL property to \c{true}:
diff --git a/src/charts/doc/src/examples-percentbarchart.qdoc b/src/charts/doc/src/examples-percentbarchart.qdoc
index 4fd52e31..ea93a185 100644
--- a/src/charts/doc/src/examples-percentbarchart.qdoc
+++ b/src/charts/doc/src/examples-percentbarchart.qdoc
@@ -44,6 +44,10 @@
\image examples_percentbarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Percent Bar Charts
+
The barsets are used in same way in all barcharts.
To illustrate the difference between various barcharts, we use the same data in all examples.
The data visualized by the bar chart is defined by QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-piechart.qdoc b/src/charts/doc/src/examples-piechart.qdoc
index 63f2b7d9..d67cbb31 100644
--- a/src/charts/doc/src/examples-piechart.qdoc
+++ b/src/charts/doc/src/examples-piechart.qdoc
@@ -35,4 +35,6 @@
\brief The example shows how to create a simple pie chart and do some customizations to
a pie slice.
\image examples_piechart.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-piechartcustomization.qdoc b/src/charts/doc/src/examples-piechartcustomization.qdoc
index 768e02ac..905c23d3 100644
--- a/src/charts/doc/src/examples-piechartcustomization.qdoc
+++ b/src/charts/doc/src/examples-piechartcustomization.qdoc
@@ -34,4 +34,6 @@
\brief This example shows how the look and feel of a pie chart can be customized.
\image piechart_customization.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-piechartdrilldown.qdoc b/src/charts/doc/src/examples-piechartdrilldown.qdoc
index edf7786b..b3e07088 100644
--- a/src/charts/doc/src/examples-piechartdrilldown.qdoc
+++ b/src/charts/doc/src/examples-piechartdrilldown.qdoc
@@ -35,4 +35,6 @@
\brief The example shows how to implement a piechart with drilldown effect.
\image examples_piechartdrill1.png
\image examples_piechartdrill2.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-polarchart.qdoc b/src/charts/doc/src/examples-polarchart.qdoc
index 978d3709..b16139e3 100644
--- a/src/charts/doc/src/examples-polarchart.qdoc
+++ b/src/charts/doc/src/examples-polarchart.qdoc
@@ -39,6 +39,10 @@
\image examples_polarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Polar Charts
+
Creating a polar chart is done with a QPolarChart instance instead of a QChart instance.
\snippet polarchart/main.cpp 1
diff --git a/src/charts/doc/src/examples-qmlaxes.qdoc b/src/charts/doc/src/examples-qmlaxes.qdoc
index 92366804..7ad066eb 100644
--- a/src/charts/doc/src/examples-qmlaxes.qdoc
+++ b/src/charts/doc/src/examples-qmlaxes.qdoc
@@ -34,10 +34,15 @@
\brief This is a demonstration of how to use axes in your QML application.
+ \include examples-run.qdocinc
+
+ \section1 Using Axes in Qt Quick Applications
+
We begin with a chart that has a line series and a scatter series with random
data. Both series use the same axes.
\image examples_qmlaxes1.png
+
\snippet qmlaxes/qml/qmlaxes/View1.qml 1
The next example shows a chart with some accurate historical data that makes us to use a DateTimeAxis.
diff --git a/src/charts/doc/src/examples-qmlchart.qdoc b/src/charts/doc/src/examples-qmlchart.qdoc
index 641d95e0..bbeaf046 100644
--- a/src/charts/doc/src/examples-qmlchart.qdoc
+++ b/src/charts/doc/src/examples-qmlchart.qdoc
@@ -34,6 +34,10 @@
\brief This basic demonstration shows how to use the different chart types by using qml.
+ \include examples-run.qdocinc
+
+ \section1 Creating Charts Using QML
+
Creating each chart type begins with the creation of a ChartView.
To create a pie, we use the PieSeries API together with a few PieSlices:
diff --git a/src/charts/doc/src/examples-qmlcustomizations.qdoc b/src/charts/doc/src/examples-qmlcustomizations.qdoc
index fe24374a..43c42d95 100644
--- a/src/charts/doc/src/examples-qmlcustomizations.qdoc
+++ b/src/charts/doc/src/examples-qmlcustomizations.qdoc
@@ -39,6 +39,10 @@
This example shows a wheel of fortune by customizing a pie series.
+ \include examples-run.qdocinc
+
+ \section1 Customizing Chart Views
+
First we create the ChartView and a couple of series.
\snippet qmlcustomizations/qml/qmlcustomizations/main.qml 1
diff --git a/src/charts/doc/src/examples-qmlcustomlegend.qdoc b/src/charts/doc/src/examples-qmlcustomlegend.qdoc
index 5374f1e4..0b42bbec 100644
--- a/src/charts/doc/src/examples-qmlcustomlegend.qdoc
+++ b/src/charts/doc/src/examples-qmlcustomlegend.qdoc
@@ -41,6 +41,11 @@
the stacked areas is created. See ChartViewStacked.qml and AnimatedAreaSeries.qml.
\image examples_qmlcustomlegend1.png
+
+ \include examples-run.qdocinc
+
+ \section1 Customizing Legends
+
\snippet qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml 1
Hovering with mouse on top of the legend will highlight the hovered series.
diff --git a/src/charts/doc/src/examples-qmlf1legends.qdoc b/src/charts/doc/src/examples-qmlf1legends.qdoc
index 45f9563f..998e6f00 100644
--- a/src/charts/doc/src/examples-qmlf1legends.qdoc
+++ b/src/charts/doc/src/examples-qmlf1legends.qdoc
@@ -36,6 +36,10 @@
\brief This application demonstrates how to use XmlListModel as a datasource for a Chart.
+ \include examples-run.qdocinc
+
+ \section1 Using List Models as Data Sources
+
Let's define an empty ChartView first:
\snippet qmlf1legends/qml/qmlf1legends/main.qml 1
diff --git a/src/charts/doc/src/examples-qmloscilloscope.qdoc b/src/charts/doc/src/examples-qmloscilloscope.qdoc
index 207200cb..677bc7a4 100644
--- a/src/charts/doc/src/examples-qmloscilloscope.qdoc
+++ b/src/charts/doc/src/examples-qmloscilloscope.qdoc
@@ -47,6 +47,10 @@
configurable options of the example application to find the configuration that gives you the
best performance in your environment.
+ \include examples-run.qdocinc
+
+ \section1 Creating Views
+
The application window is shared by control and scope views:
\snippet qmloscilloscope/qml/qmloscilloscope/main.qml 1
\dots
diff --git a/src/charts/doc/src/examples-qmlpolarchart.qdoc b/src/charts/doc/src/examples-qmlpolarchart.qdoc
index e511527b..04c2b3e2 100644
--- a/src/charts/doc/src/examples-qmlpolarchart.qdoc
+++ b/src/charts/doc/src/examples-qmlpolarchart.qdoc
@@ -34,6 +34,10 @@
\brief This is a demonstration on how to use a polar chart in your QML application.
+ \include examples-run.qdocinc
+
+ \section1 Using Polar Charts in Qt Quick Applications
+
We begin with a chart that has a spline series and a scatter series with random
data. Both series use the same axes.
diff --git a/src/charts/doc/src/examples-qmlweather.qdoc b/src/charts/doc/src/examples-qmlweather.qdoc
index a43f6438..ef4e88c8 100644
--- a/src/charts/doc/src/examples-qmlweather.qdoc
+++ b/src/charts/doc/src/examples-qmlweather.qdoc
@@ -46,6 +46,10 @@
bin\qmlweather.exe 1234567890abcdef123456
\endcode
+ \include examples-run.qdocinc
+
+ \section1 Using Charts in Qt Quick Applications
+
The example application uses a ChartView and a some series to visualize weather data:
\snippet qmlweather/qml/qmlweather/main.qml 1
\snippet qmlweather/qml/qmlweather/main.qml 2
diff --git a/src/charts/doc/src/examples-scatterchart.qdoc b/src/charts/doc/src/examples-scatterchart.qdoc
index 1aaa16a2..08c12c09 100644
--- a/src/charts/doc/src/examples-scatterchart.qdoc
+++ b/src/charts/doc/src/examples-scatterchart.qdoc
@@ -36,6 +36,10 @@
\image examples_scatterchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Scatter Charts
+
To create scatter charts, a QScatterSeries instance is needed. Here we create a scatter series
instance, and set the type and width of outline for the scatter points.
diff --git a/src/charts/doc/src/examples-scatterinteractions.qdoc b/src/charts/doc/src/examples-scatterinteractions.qdoc
index b9703177..398a1cee 100644
--- a/src/charts/doc/src/examples-scatterinteractions.qdoc
+++ b/src/charts/doc/src/examples-scatterinteractions.qdoc
@@ -36,4 +36,6 @@
chart.
\image examples_scatterinteractions.png
+
+ \include examples-run.qdocinc
*/
diff --git a/src/charts/doc/src/examples-splinechart.qdoc b/src/charts/doc/src/examples-splinechart.qdoc
index c5fa1634..a5ca9cf6 100644
--- a/src/charts/doc/src/examples-splinechart.qdoc
+++ b/src/charts/doc/src/examples-splinechart.qdoc
@@ -36,6 +36,10 @@
\image examples_splinechart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Spline Charts
+
To create spline charts we need to put our data into QSplineSeries. QSplineSeries automatically
calculates spline segment control points that are needed to properly draw the spline.
diff --git a/src/charts/doc/src/examples-stackedbarchart.qdoc b/src/charts/doc/src/examples-stackedbarchart.qdoc
index d9450c41..e52a32b9 100644
--- a/src/charts/doc/src/examples-stackedbarchart.qdoc
+++ b/src/charts/doc/src/examples-stackedbarchart.qdoc
@@ -43,6 +43,10 @@
\image examples_stackedbarchart.png
+ \include examples-run.qdocinc
+
+ \section1 Creating Stacked Bar Charts
+
The barsets are used in same way in all barcharts.
To illustrate the difference between various barcharts, we use same data in all examples.
Data, which the barchart visualizes, is defined by the QBarSet instances. Here we create the sets and append data
diff --git a/src/charts/doc/src/examples-stackedbarchartdrilldown.qdoc b/src/charts/doc/src/examples-stackedbarchartdrilldown.qdoc
index ce462c98..7106dda6 100644
--- a/src/charts/doc/src/examples-stackedbarchartdrilldown.qdoc
+++ b/src/charts/doc/src/examples-stackedbarchartdrilldown.qdoc
@@ -45,6 +45,10 @@
Clicking on a month shows that month's harvest:
\image examples_stackedbarchartdrilldown2.png
+ \include examples-run.qdocinc
+
+ \section1 Implementing Drilldown
+
First we define a drilldown series class, which adds categories to the stacked bar series and mapping for categories to other drilldown series.
The purpose of the drilldown series is to contain knowledge of the drilldown structure. The mapDrilldownSeries function maps the category to a given series. We can request the mapping for a category with the drilldownSeries(int category) function.
diff --git a/src/charts/doc/src/examples-temperaturerecords.qdoc b/src/charts/doc/src/examples-temperaturerecords.qdoc
index 39843158..555666e0 100644
--- a/src/charts/doc/src/examples-temperaturerecords.qdoc
+++ b/src/charts/doc/src/examples-temperaturerecords.qdoc
@@ -38,6 +38,10 @@
\image examples_temperaturerecords.png
+ \include examples-run.qdocinc
+
+ \section1 Crating Negative Bars
+
First we create two barsets and append the data to them. One set represents the minimum temperatures and another the maximum temperatures.
\snippet temperaturerecords/main.cpp 1
diff --git a/src/charts/doc/src/examples-zoomlinechart.qdoc b/src/charts/doc/src/examples-zoomlinechart.qdoc
index e13b737c..a7eed9b6 100644
--- a/src/charts/doc/src/examples-zoomlinechart.qdoc
+++ b/src/charts/doc/src/examples-zoomlinechart.qdoc
@@ -39,6 +39,10 @@
\image examples_zoomlinechart1.png
\image examples_zoomlinechart2.png
+ \include examples-run.qdocinc
+
+ \section1 Customizing Zooming Effects
+
Let's first create a line series with some example data.
\snippet zoomlinechart/main.cpp 1
diff --git a/src/charts/doc/src/index.qdoc b/src/charts/doc/src/index.qdoc
index 21874b5f..1b736be4 100644
--- a/src/charts/doc/src/index.qdoc
+++ b/src/charts/doc/src/index.qdoc
@@ -57,14 +57,14 @@
\snippet doc_src_qtcharts.pro 0
- \section1 References
+ \section1 Examples
\list
- \li \l{Qt Charts C++ Classes}
- \li \l{Qt Charts QML Types}
+ \li \l{Qt Charts Examples}
\endlist
- Qt Charts comes with the following examples:
-
- \annotatedlist qtcharts_examples
-
+ \section1 API Reference
+ \list
+ \li \l{Qt Charts C++ Classes}{C++ Classes}
+ \li \l{Qt Charts QML Types}{QML Types}
+ \endlist
*/
diff --git a/src/charts/doc/src/qtcharts.qdoc b/src/charts/doc/src/qtcharts.qdoc
index fff47320..21deb4e1 100644
--- a/src/charts/doc/src/qtcharts.qdoc
+++ b/src/charts/doc/src/qtcharts.qdoc
@@ -74,15 +74,13 @@
*/
/*!
- \group charts_examples
+ \group qtcharts_examples
\ingroup all-examples
\title Qt Charts Examples
\brief Examples for the Qt Charts.
- For some code examples, see one of the Qt Charts examples:
+ The Qt Charts examples demonstrate how to use charts in widget-based and
+ Qt Quick applications:
- \section1 Examples
-
- \annotatedlist qtcharts_examples
*/
diff --git a/src/charts/linechart/linechartitem.cpp b/src/charts/linechart/linechartitem.cpp
index 03099356..04e00c35 100644
--- a/src/charts/linechart/linechartitem.cpp
+++ b/src/charts/linechart/linechartitem.cpp
@@ -373,6 +373,14 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
return;
QRectF clipRect = QRectF(QPointF(0, 0), domain()->size());
+ // Adjust clip rect half a pixel in required dimensions to make it include lines along the
+ // plot area edges, but never increase clip so much that any portion of the line is draw beyond
+ // the plot area.
+ const qreal x1 = pos().x() - int(pos().x());
+ const qreal y1 = pos().y() - int(pos().y());
+ const qreal x2 = (clipRect.width() + 0.5) - int(clipRect.width() + 0.5);
+ const qreal y2 = (clipRect.height() + 0.5) - int(clipRect.height() + 0.5);
+ clipRect.adjust(-x1, -y1, qMax(x1, x2), qMax(y1, y2));
painter->save();
painter->setPen(m_linePen);
diff --git a/src/charts/piechart/piechartitem.cpp b/src/charts/piechart/piechartitem.cpp
index 49a913f3..35ba08fd 100644
--- a/src/charts/piechart/piechartitem.cpp
+++ b/src/charts/piechart/piechartitem.cpp
@@ -27,17 +27,17 @@
**
****************************************************************************/
+#include <QtCharts/qpieslice.h>
+#include <QtCharts/qpieseries.h>
+#include <QtWidgets/qgraphicssceneevent.h>
+
#include <private/piechartitem_p.h>
#include <private/piesliceitem_p.h>
-#include <QtCharts/QPieSlice>
#include <private/qpieslice_p.h>
-#include <QtCharts/QPieSeries>
#include <private/qpieseries_p.h>
#include <private/chartpresenter_p.h>
#include <private/chartdataset_p.h>
#include <private/pieanimation_p.h>
-#include <QtGui/QPainter>
-#include <QtCore/QTimer>
QT_CHARTS_BEGIN_NAMESPACE
@@ -68,15 +68,7 @@ PieChartItem::PieChartItem(QPieSeries *series, QGraphicsItem* item)
PieChartItem::~PieChartItem()
{
- // slices deleted automatically through QGraphicsItem
- if (m_series) {
- m_series->disconnect(this);
- QPieSeriesPrivate::fromSeries(m_series)->disconnect(this);
- }
- foreach (QPieSlice *slice, m_sliceItems.keys()) {
- slice->disconnect(this);
- QPieSlicePrivate::fromSlice(slice)->disconnect(this);
- }
+ cleanup();
}
void PieChartItem::setAnimation(PieAnimation *animation)
@@ -89,6 +81,48 @@ ChartAnimation *PieChartItem::animation() const
return m_animation;
}
+void PieChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
+{
+ event->ignore();
+}
+
+void PieChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
+{
+ event->ignore();
+}
+
+void PieChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ event->ignore();
+}
+
+void PieChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ event->ignore();
+}
+
+void PieChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ event->ignore();
+}
+
+void PieChartItem::cleanup()
+{
+ ChartItem::cleanup();
+
+ // slice items deleted automatically through QGraphicsItem
+ if (m_series) {
+ m_series->disconnect(this);
+ QPieSeriesPrivate::fromSeries(m_series)->disconnect(this);
+ m_series = 0;
+ }
+ foreach (QPieSlice *slice, m_sliceItems.keys()) {
+ slice->disconnect(this);
+ QPieSlicePrivate::fromSlice(slice)->disconnect(this);
+ }
+ m_sliceItems.clear();
+}
+
void PieChartItem::handleDomainUpdated()
{
QRectF rect(QPointF(0,0),domain()->size());
diff --git a/src/charts/piechart/piechartitem_p.h b/src/charts/piechart/piechartitem_p.h
index bfbbb77a..9c178271 100644
--- a/src/charts/piechart/piechartitem_p.h
+++ b/src/charts/piechart/piechartitem_p.h
@@ -65,6 +65,13 @@ public:
QRectF boundingRect() const { return m_rect; }
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {}
+protected:
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+
public Q_SLOTS:
// from Chart
virtual void handleDomainUpdated();
@@ -79,6 +86,8 @@ public Q_SLOTS:
void setAnimation(PieAnimation *animation);
ChartAnimation *animation() const;
+ // From ChartItem
+ void cleanup();
private:
PieSliceData updateSliceGeometry(QPieSlice *slice);
diff --git a/src/charts/qabstractseries.cpp b/src/charts/qabstractseries.cpp
index 9f2c21b9..39ec2aa9 100644
--- a/src/charts/qabstractseries.cpp
+++ b/src/charts/qabstractseries.cpp
@@ -43,59 +43,81 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QAbstractSeries
\inmodule Qt Charts
- \brief Base class for all Qt Chart series.
+ \brief The QAbstractSeries class is a base class for all Qt Chart series.
- Usually you use the series type specific inherited classes instead of the base class.
- \sa QXYSeries, QLineSeries, QSplineSeries, QScatterSeries, QAreaSeries, QAbstractBarSeries, QStackedBarSeries,
- QPercentBarSeries, QPieSeries
+ Usually, the series type specific inherited classes are used instead of the base class.
+
+ \sa QXYSeries, QLineSeries, QSplineSeries, QScatterSeries, QAreaSeries, QAbstractBarSeries
+ \sa QBarSeries, QStackedBarSeries, QPercentBarSeries, QHorizontalBarSeries
+ \sa QHorizontalStackedBarSeries, QHorizontalPercentBarSeries, QPieSeries
*/
/*!
\qmltype AbstractSeries
\instantiates QAbstractSeries
\inqmlmodule QtCharts
- \brief Base class for all Qt Chart series.
+ \brief Base type for all Qt Chart series types.
- AbstractSeries is the base class for all series.
- The class cannot be instantiated by the user.
+ This type cannot be instantiated directly. Instead, one of the following derived types
+ should be used to create a series: LineSeries, AreaSeries, BarSeries, StackedBarSeries,
+ PercentBarSeries, HorizontalBarSeries, HorizontalStackedBarSeries, HorizontalPercentBarSeries,
+ PieSeries, ScatterSeries, SplineSeries, BoxPlotSeries, or CandlestickSeries.
*/
/*!
\enum QAbstractSeries::SeriesType
- The type of the series object.
-
- \value SeriesTypeLine
- \value SeriesTypeArea
- \value SeriesTypeBar
- \value SeriesTypeStackedBar
- \value SeriesTypePercentBar
- \value SeriesTypePie
- \value SeriesTypeScatter
- \value SeriesTypeSpline
- \value SeriesTypeHorizontalBar
- \value SeriesTypeHorizontalStackedBar
- \value SeriesTypeHorizontalPercentBar
- \value SeriesTypeBoxPlot
- \value SeriesTypeCandlestick
+ This enum describes the type of the series.
+
+ \value SeriesTypeLine A line chart.
+ \value SeriesTypeArea An area chart.
+ \value SeriesTypeBar A vertical bar chart.
+ \value SeriesTypeStackedBar A vertical stacked bar chart.
+ \value SeriesTypePercentBar A vertical percent bar chart.
+ \value SeriesTypePie A pie chart.
+ \value SeriesTypeScatter A scatter chart.
+ \value SeriesTypeSpline A spline chart.
+ \value SeriesTypeHorizontalBar A horizontal bar chart.
+ \value SeriesTypeHorizontalStackedBar A horizontal stacked bar chart.
+ \value SeriesTypeHorizontalPercentBar A horizontal percent bar chart.
+ \value SeriesTypeBoxPlot A box plot chart.
+ \value SeriesTypeCandlestick A candlestick chart.
*/
/*!
\property QAbstractSeries::type
- The type of the series.
+ \brief The type of the series.
*/
/*!
- \qmlproperty ChartView.SeriesType AbstractSeries::type
+ \qmlproperty enumeration AbstractSeries::type
+
The type of the series.
+
+ \value AbstractSeries.SeriesTypeLine A line chart.
+ \value AbstractSeries.SeriesTypeArea An area chart.
+ \value AbstractSeries.SeriesTypeBar A vertical bar chart.
+ \value AbstractSeries.SeriesTypeStackedBar A vertical stacked bar chart.
+ \value AbstractSeries.SeriesTypePercentBar A vertical percent bar chart.
+ \value AbstractSeries.SeriesTypePie A pie chart.
+ \value AbstractSeries.SeriesTypeScatter A scatter chart.
+ \value AbstractSeries.SeriesTypeSpline A spline chart.
+ \value AbstractSeries.SeriesTypeHorizontalBar A horizontal bar chart.
+ \value AbstractSeries.SeriesTypeHorizontalStackedBar A horizontal stacked bar chart.
+ \value AbstractSeries.SeriesTypeHorizontalPercentBar A horizontal percent bar chart.
+ \value AbstractSeries.SeriesTypeBoxPlot A box plot chart.
+ \value AbstractSeries.SeriesTypeCandlestick A candlestick chart.
*/
/*!
\property QAbstractSeries::name
- \brief name of the series property. The name is shown in legend for series and supports html formatting.
+ \brief The name of the series.
+
+ The name is displayed in the legend for the series and it supports HTML formatting.
*/
/*!
\qmlproperty string AbstractSeries::name
- Name of the series. The name is shown in legend for series and supports html formatting.
+ The name of the series. It is displayed in the legend for the series and it
+ supports HTML formatting.
*/
/*!
@@ -109,56 +131,58 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QAbstractSeries::visible
- \brief whether the series is visible or not; true by default.
+ \brief whether the series is visible or not.
+
+ By default, \c true.
*/
/*!
\qmlproperty bool AbstractSeries::visible
- Visibility of the series. True by default.
+ Visibility of the series. By default, \c true.
*/
/*!
\fn void QAbstractSeries::visibleChanged()
- Emitted when the series visibility changes.
+ This signal is emitted when the series visibility changes.
*/
/*!
\qmlsignal AbstractSeries::onVisibleChanged()
- Emitted when the series visibility changes.
+ This signal is emitted when the series visibility changes.
*/
/*!
\property QAbstractSeries::opacity
\brief The opacity of the series.
- By default the opacity is 1.0. The valid values range from 0.0 (transparent) to 1.0 (opaque).
+ By default, the opacity is 1.0. The valid values range from 0.0 (transparent) to 1.0 (opaque).
*/
/*!
\qmlproperty real AbstractSeries::opacity
- The opacity of the series. By default the opacity is 1.0.
+ The opacity of the series. By default, the opacity is 1.0.
The valid values range from 0.0 (transparent) to 1.0 (opaque).
*/
/*!
\fn void QAbstractSeries::opacityChanged()
- Emitted when the opacity of the series changes.
+ This signal is emitted when the opacity of the series changes.
*/
/*!
\qmlsignal AbstractSeries::onOpacityChanged()
- Emitted when the opacity of the series changes.
+ This signal is emitted when the opacity of the series changes.
*/
/*!
\property QAbstractSeries::useOpenGL
- \brief Specifies whether or not the series drawing is accelerated with OpenGL.
+ \brief Specifies whether or not drawing the series is accelerated by using OpenGL.
- Drawing series with OpenGL is supported only for QLineSeries and QScatterSeries.
- Line series used as edge series for a QAreaSeries cannot use OpenGL acceleration.
+ Acceleration using OpenGL is supported only for QLineSeries and QScatterSeries.
+ A line series used as an edge series for QAreaSeries cannot use OpenGL acceleration.
When a chart contains any series that are drawn with OpenGL, a transparent QOpenGLWidget
is created on top of the chart plot area. The accelerated series are not drawn on the underlying
QGraphicsView, but are instead drawn on the created QOpenGLWidget.
Performance gained from using OpenGL to accelerate series drawing depends on the underlying
hardware, but in most cases it is significant. For example, on a standard desktop computer,
- enabling OpenGL acceleration for a series typically allows rendering at least hundred times
+ enabling OpenGL acceleration for a series typically allows rendering at least a hundred times
more points without reduction on the frame rate.
Chart size also has less effect on the frame rate.
@@ -200,8 +224,8 @@ QT_CHARTS_BEGIN_NAMESPACE
\qmlproperty bool AbstractSeries::useOpenGL
Specifies whether or not the series is drawn with OpenGL.
- Drawing series with OpenGL is supported only for LineSeries and ScatterSeries.
- Line series used as edge series for a AreaSeries cannot use OpenGL acceleration.
+ Acceleration using OpenGL is supported only for LineSeries and ScatterSeries.
+ A line series used as an edge series for a AreaSeries cannot use OpenGL acceleration.
When a chart contains any series that are drawn with OpenGL, an additional transparent child
node is created for the ChartView node. The accelerated series are not drawn on the
ChartView node, but are instead drawn on the child node.
@@ -237,11 +261,13 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\fn void QAbstractSeries::useOpenGLChanged()
- Emitted when the useOpenGL property value changes.
+ This signal is emitted when accelerating the drawing of the series by using OpenGL
+ is enabled or disabled.
*/
/*!
\qmlsignal AbstractSeries::onUseOpenGLChanged()
- Emitted when the useOpenGL property value changes.
+ This signal is emitted when accelerating the drawing of the series by using OpenGL
+ is enabled or disabled.
*/
/*!
@@ -325,9 +351,9 @@ bool QAbstractSeries::useOpenGL() const
}
/*!
- \brief Returns the chart where series belongs to.
+ Returns the chart that the series belongs to.
- Set automatically when the series is added to the chart
+ Set automatically when the series is added to the chart,
and unset when the series is removed from the chart.
*/
QChart *QAbstractSeries::chart() const
@@ -336,7 +362,7 @@ QChart *QAbstractSeries::chart() const
}
/*!
- \brief Sets the visibility of the series to true.
+ Sets the visibility of the series to \c true.
\sa setVisible(), isVisible()
*/
@@ -346,7 +372,7 @@ void QAbstractSeries::show()
}
/*!
- \brief Sets the visibility of the series to false.
+ Sets the visibility of the series to \c false.
\sa setVisible(), isVisible()
*/
@@ -356,10 +382,13 @@ void QAbstractSeries::hide()
}
/*!
- Attach \a axis to the series.
- \return true if the axis was attached successfully, false otherwise.
- \note If multiple axes of same orientation are attached to same series,
- they will have same min/max ranges.
+ Attaches the axis specified by \a axis to the series.
+
+ Returns \c true if the axis was attached successfully, \c false otherwise.
+
+ \note If multiple axes of the same orientation are attached to the same series,
+ they will have the same minimum and maximum values.
+
\sa QChart::addAxis(), QChart::createDefaultAxes()
*/
bool QAbstractSeries::attachAxis(QAbstractAxis* axis)
@@ -373,8 +402,10 @@ bool QAbstractSeries::attachAxis(QAbstractAxis* axis)
}
/*!
- Detach \a axis from the series.
- \return true if the axis was detached successfully, false otherwise.
+ Detaches the axis specified by \a axis from the series.
+
+ Returns \c true if the axis was detached successfully, \c false otherwise.
+
\sa QChart::removeAxis()
*/
bool QAbstractSeries::detachAxis(QAbstractAxis* axis)
@@ -389,8 +420,8 @@ bool QAbstractSeries::detachAxis(QAbstractAxis* axis)
}
/*!
- Returns the list of axes attached to the series. Usually there is an x-axis and a y-axis attached to a series, except
- in case of a QPieSeries, which does not have any axes attached.
+ Returns the list of axes attached to the series. Usually, an x-axis and a y-axis
+ are attached to a series, except for QPieSeries, which does not have any axes attached.
\sa attachAxis(), detachAxis()
*/
QList<QAbstractAxis*> QAbstractSeries::attachedAxes()
diff --git a/src/charts/qchartglobal.h b/src/charts/qchartglobal.h
index 4a0d5601..46c5f400 100644
--- a/src/charts/qchartglobal.h
+++ b/src/charts/qchartglobal.h
@@ -66,6 +66,11 @@
# define QT_CHARTS_USE_NAMESPACE
#endif
+// Make sure we have used the namespace at least once to avoid compile errors when including
+// the QtCharts umbrella header.
+QT_CHARTS_BEGIN_NAMESPACE
+QT_CHARTS_END_NAMESPACE
+
/*
On Windows min and max conflict with standard macros
*/
diff --git a/src/charts/xychart/glxyseriesdata.cpp b/src/charts/xychart/glxyseriesdata.cpp
index 9a6f330a..54c533b2 100644
--- a/src/charts/xychart/glxyseriesdata.cpp
+++ b/src/charts/xychart/glxyseriesdata.cpp
@@ -82,6 +82,7 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
foreach (QAbstractAxis* axis, series->attachedAxes()) {
if (axis->type() == QAbstractAxis::AxisTypeLogValue) {
logAxis = true;
+ break;
}
if (axis->isReverse()) {
if (axis->orientation() == Qt::Horizontal)
@@ -96,11 +97,6 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
int index = 0;
array.resize(count * 2);
QMatrix4x4 matrix;
- if (reverseX)
- matrix.scale(-1.0, 1.0);
- if (reverseY)
- matrix.scale(1.0, -1.0);
- data->matrix = matrix;
if (logAxis) {
// Use domain to resolve geometry points. Not as fast as shaders, but simpler that way
QVector<QPointF> geometryPoints = domain->calculateGeometryPoints(series->pointsVector());
@@ -122,6 +118,10 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
data->delta = QVector2D(domain->size().width() / 2.0f, domain->size().height() / 2.0f);
} else {
// Regular value axes, so we can do the math easily on shaders.
+ if (reverseX)
+ matrix.scale(-1.0, 1.0);
+ if (reverseY)
+ matrix.scale(1.0, -1.0);
QVector<QPointF> seriesPoints = series->pointsVector();
for (int i = 0; i < count; i++) {
const QPointF &point = seriesPoints.at(i);
@@ -132,6 +132,7 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
data->delta = QVector2D((domain->maxX() - domain->minX()) / 2.0f,
(domain->maxY() - domain->minY()) / 2.0f);
}
+ data->matrix = matrix;
data->dirty = true;
}
diff --git a/src/chartsqml2/declarativeboxplotseries.cpp b/src/chartsqml2/declarativeboxplotseries.cpp
index 1ae3163e..abe53f4f 100644
--- a/src/chartsqml2/declarativeboxplotseries.cpp
+++ b/src/chartsqml2/declarativeboxplotseries.cpp
@@ -39,84 +39,103 @@ QT_CHARTS_BEGIN_NAMESPACE
\instantiates QBoxSet
\inqmlmodule QtCharts
- \brief Building block for box-and-whiskers chart.
+ \brief Represents one item in a box-and-whiskers chart.
+
+ A box-and-whiskers item is a graphical representation of a range and three median values
+ that is constructed from five different values. There are two ways to specify the values.
+ The first one is by using a constructor or the append() method. The values have to be
+ specified in the following order: lower extreme, lower quartile, median, upper quartile,
+ and upper extreme.
+
+ The second way is to create an empty BoxSet instance and specify the values using the
+ setValue() method.
- BoxSet represents one box-and-whiskers item. It takes five values to create a graphical
- representation of range and three medians. There are two ways to give the values. The first one
- is with constructor or with append method. In these the values have to be given in the following
- order: lower extreme, lower quartile, median, upper quartile and upper extreme. The second
- method is to create an empty QBoxSet instance and give the values using value specific methods.
\sa BoxPlotSeries
*/
+
+/*!
+ \qmlproperty enumeration BoxSet::ValuePositions
+
+ This enum type defines the values of a box-and-whiskers item:
+
+ \value BoxSet.LowerExtreme The smallest value of the box-and-whiskers item.
+ \value BoxSet.LowerQuartile The median value of the lower half of the box-and-whiskers item.
+ \value BoxSet.Median The median value of the box-and-whiskers item.
+ \value BoxSet.UpperQuartile The median value of the upper half of the box-and-whiskers item.
+ \value BoxSet.UpperExtreme The largest value of the box-and-whiskers item.
+*/
+
/*!
\qmlproperty string BoxSet::values
- The values on the box-and-whiskers set.
+ The values of the box-and-whiskers item.
*/
/*!
\qmlproperty string BoxSet::label
- Defines the label of the category of the box-and-whiskers set.
+ The label of the category of the box-and-whiskers item.
*/
/*!
\qmlproperty int BoxSet::count
- The count of values on the box-and-whiskers set
+ The number of values of the box-and-whiskers item.
*/
/*!
\qmlmethod void BoxSet::at(int index)
- Returns the value at \a index position.
+ Returns the value in the position specified by \a index.
*/
/*!
\qmlmethod void BoxSet::append(qreal value)
- Appends new value \a value to the end of set.
+ Appends the new value specified by \a value to the end of the box-and-whiskers item.
*/
/*!
\qmlmethod void BoxSet::clear()
- Sets all values on the set to 0.
+ Sets all the values of the box-and-whiskers item to 0.
*/
/*!
\qmlmethod void BoxSet::setValue(int index, qreal value)
- Sets a new \a value on the \a index position.
+ Sets the value specified by \a value in the position specified by \a index.
*/
/*!
\qmlsignal BoxSet::onClicked()
- This signal is emitted when the user clicks with a mouse on top of box-and-whiskers item.
+ This signal is emitted when the user clicks a box-and-whiskers item in the chart.
*/
/*!
\qmlsignal BoxSet::onPressed()
- This signal is emitted when the user presses with a mouse on top of box-and-whiskers item.
+ This signal is emitted when the user clicks a box-and-whiskers item in the chart
+ and holds down the mouse button.
*/
/*!
\qmlsignal BoxSet::onReleased()
- This signal is emitted when the user releases with a mouse on top of box-and-whiskers item.
+ This signal is emitted when the user releases the mouse press on a box-and-whiskers item.
*/
/*!
\qmlsignal BoxSet::onDoubleClicked()
- This signal is emitted when the user doubleclicks with a mouse on top of box-and-whiskers item.
+ This signal is emitted when the user double-clicks a box-and-whiskers item.
*/
/*!
\qmlsignal BoxSet::onHovered(bool status)
- The signal is emitted if mouse is hovered on top of box-and-whiskers item.
- Parameter \a status is true, if mouse entered on top of the item, and false if mouse left from top of the item.
+ This signal is emitted when a mouse is hovered over a box-and-whiskers item in a chart.
+ When the mouse moves over the item, \a status turns \c true, and when the mouse moves
+ away again, it turns \c false.
*/
/*!
\qmlsignal BoxSet::onPenChanged()
- This signal is emitted when the pen of the box-and-whiskers item has changed.
+ This signal is emitted when the pen used to draw the lines of the box-and-whiskers item changes.
*/
/*!
\qmlsignal BoxSet::onBrushChanged()
- This signal is emitted when the brush of the box-and-whiskers item has changed.
+ This signal is emitted when the brush used to fill the box of the box-and-whiskers item changes.
*/
/*!
\qmlsignal BoxSet::onChangedValues()
- This signal is emitted when multiple values have been changed on the box-and-whiskers item.
+ This signal is emitted when multiple values of the box-and-whiskers item change.
*/
/*!
\qmlsignal BoxSet::onChangedValue(int index)
- This signal is emitted values the value in the box-and-whiskers item has been modified.
- Parameter \a index indicates the position of the modified value.
+ This signal is emitted when the value of the box-and-whiskers item specified by \a index
+ changes.
*/
/*!
\qmlsignal BoxSet::onCleared()
- This signal is emitted when all the values on the set are cleared to 0.
+ This signal is emitted when all the values of the box-and-whiskers item are set to 0.
*/
/*!
@@ -126,18 +145,16 @@ QT_CHARTS_BEGIN_NAMESPACE
\inherits AbstractSeries
- \brief Series for creating box-and-whiskers chart.
+ \brief Presents data in box-and-whiskers charts.
- BoxPlotSeries represents a series of data shown as box-and-whiskers bars. The purpose of this
- class is to act as a container for single box-and-whiskers items. Each item is drawn to own
- slot. If chart includes multiple instances of BoxPlotSeries then box-and-whiskers items with the
- same index are drawn to same slot.
+ A box plot series acts as a container for box-and-whiskers items. Items from multiple series
+ are grouped into categories according to their index value.
- \note The slot, each item in BoxPlotSeries is drawn, represents a category in BarCategoryAxis.
- The category labels have to be unique. If same category label is defined for several
- box-and-whisker items only the first one is drawn.
+ The BarCategoryAxis class is used to add the categories to the chart's axis. Category labels
+ have to be unique. If the same category label is defined for several box-and-whiskers items,
+ only the first one is drawn.
- The following QML shows how to create a simple box-and-whiskers chart:
+ The following QML code snippet shows how to create a simple box-and-whiskers chart:
\code
import QtQuick 2.0
import QtCharts 2.0
@@ -171,31 +188,36 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlmethod BoxPlotSeries::append(string label, VariantList values)
- Appends a new box-and-whiskers set with \a label and \a values to the series.
+ Appends a new box-and-whiskers item with the label specified by \a label and the values
+ specified by \a values to the series.
*/
/*!
\qmlmethod BoxPlotSeries::append(BoxSet box)
- Appends the \a box to the series.
+ Appends the box-and-whiskers item specified by \a box to the series.
*/
/*!
\qmlmethod BoxPlotSeries::insert(int index, string label, VariantList values)
- Inserts a new box-and-whiskers set with \a label and \a values at the \a index position.
+ Inserts a new box-and-whiskers item with the label specified by \a label and the values
+ specified by \a values to the series at the position specified by \a index.
*/
/*!
\qmlmethod BoxPlotSeries::remove(QBoxSet boxset)
- Removes the \a boxset from the series.
+ Removes the box-and-whiskers item specified by \a boxset from the series.
*/
/*!
\qmlmethod BoxPlotSeries::clear()
- Removes all boxsets from the series. Deletes removed sets.
+ Removes all box-and-whiskers items from the series and permanently deletes them.
*/
/*!
\qmlsignal BoxPlotSeries::onClicked(BoxSet boxset);
- Signal is emitted when the user clicks the \a boxset on the chart.
+ This signal is emitted when the user clicks the box-and-whiskers item specified by
+ \a boxset in the chart.
*/
/*!
\qmlsignal BoxPlotSeries::onHovered(bool status, BoxSet boxset);
- Signal is emitted when there is change in hover \a status over \a boxset.
+ This signal is emitted when a mouse is hovered over the box-and-whiskers item specified by
+ \a boxset in the chart. When the mouse moves over the item, \a status turns \c true, and
+ when the mouse moves away again, it turns \c false.
*/
/*!
\qmlsignal BoxPlotSeries::onPressed(BoxSet boxset)
@@ -203,101 +225,115 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\qmlsignal BoxPlotSeries::onReleased(BoxSet boxset)
- This signal is emitted when the user releases the \a boxset on the chart.
+ This signal is emitted when the user releases the mouse press on the box-and-whiskers
+ item specified by \a boxset in the chart.
*/
/*!
\qmlsignal BoxPlotSeries::onDoubleClicked(BoxSet boxset)
- This signal is emitted when the user doubleclicks the \a boxset on the chart.
+ This signal is emitted when the user double-clicks the box-and-whiskers item specified by
+ \a boxset in the chart.
*/
/*!
\qmlsignal BoxPlotSeries::onCountChanged();
- Signal is emitted when there is change in count of box-and-whiskers items in the series.
+ This signal is emitted when the number of box-and-whiskers items in the series changes.
*/
/*!
\qmlsignal BoxPlotSeries::onBoxsetsAdded()
- Signal is emitted when new box-and-whiskers sets are added to the series.
+ This signal is emitted when new box-and-whiskers items are added to the series.
*/
/*!
\qmlsignal BoxPlotSeries::onBoxsetsRemoved()
- Signal is emitted when new box-and-whiskers sets are removed from the series.
+ This signal is emitted when box-and-whiskers items are removed from the series.
*/
/*!
\qmlproperty AbstractAxis BoxPlotSeries::axisX
- The x axis used for the series. If you leave both axisX and axisXTop undefined, a BarCategoriesAxis is created for
- the series.
+ The x-axis used for the series. If you leave both axisX and axisXTop undefined, a
+ BarCategoryAxis is created for the series.
\sa axisXTop
*/
/*!
\qmlproperty AbstractAxis BoxPlotSeries::axisY
- The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for
- the series.
+ The y-axis used for the series. If you leave both axisY and axisYRight undefined, a
+ ValueAxis is created for the series.
\sa axisYRight
*/
/*!
\qmlproperty AbstractAxis BoxPlotSeries::axisXTop
- The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or
- axisXTop, but not both.
+ The x-axis used for the series, drawn on top of the chart view.
+
+ \note You can only provide either axisX or axisXTop, but not both.
+ \sa axisX
+
\sa axisX
*/
/*!
\qmlproperty AbstractAxis BoxPlotSeries::axisYRight
- The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY
- or axisYRight, but not both.
+ The y-axis used for the series, drawn to the right on the chart view.
+
+ \note You can only provide either axisY or axisYRight, but not both.
\sa axisY
*/
/*!
\qmlproperty bool BoxPlotSeries::boxOutlineVisible
- This property configures the visibility of the middle box outline.
+ The visibility of the box outline.
*/
/*!
- \qmlproperty qreal BoxPlotSeries::boxWidth
- This property configures the width of the box-and-whiskers item. The value signifies the relative
- width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values
- are clamped to 0.0 and values over 1.0 are clamped to 1.0.
+ \qmlproperty real BoxPlotSeries::boxWidth
+ \brief The width of the box-and-whiskers item. The value indicates the relative
+ width of the item within its category. The value can be between 0.0 and 1.0. Negative values
+ are replaced with 0.0 and values greater than 1.0 are replaced with 1.0.
*/
/*!
\qmlproperty Pen BoxPlotSeries::pen
- This property configures the pen of the box-and-whiskers items.
+ The pen used to draw the lines of the box-and-whiskers items.
*/
/*!
\qmlproperty Brush BoxPlotSeries::brush
- This property configures the brush of the box-and-whiskers items.
+ The brush used to fill the boxes of the box-and-whiskers items.
*/
+
+/*!
+ \qmlproperty string BoxPlotSeries::brushFilename
+ The name of the file used as a brush for the series.
+*/
+
/*!
\qmlproperty int BoxPlotSeries::count
- The count of sets in series.
+ The number of box-and-whiskers items in a box plot series.
*/
/*!
\qmlsignal BoxPlotSeries::onBoxOutlineVisibilityChanged()
- Signal is emitted when the middle box outline visibility is changed.
+ This signal is emitted when the box outline visibility changes.
*/
/*!
\qmlsignal BoxPlotSeries::onBoxWidthChanged()
- Signal is emitted when the width of the box-and-whiskers item is changed.
+ This signal is emitted when the width of the box-and-whiskers item changes.
*/
/*!
\qmlsignal BoxPlotSeries::onPenChanged()
- Signal is emitted when the pen for box-and-whiskers items has changed.
+ This signal is emitted when the pen used to draw the lines of the box-and-whiskers
+ items changes.
*/
/*!
\qmlsignal BoxPlotSeries::onBrushChanged()
- Signal is emitted when the brush for box-and-whiskers items has changed.
+ This signal is emitted when the brush used to fill the boxes of the box-and-whiskers
+ items changes.
*/
/*!
\qmlsignal BoxPlotSeries::onAxisXChanged(AbstractAxis axis)
- Signal is emitted when there is change in X axis.
+ This signal is emitted when the x-axis changes to \a axis.
*/
/*!
\qmlsignal BoxPlotSeries::onAxisYChanged(AbstractAxis axis)
- Signal is emitted when there is change in Y axis.
+ This signal is emitted when the y-axis changes to \a axis.
*/
/*!
\qmlsignal BoxPlotSeries::onAxisXTopChanged(AbstractAxis axis)
- Signal is emitted when there is change in top X axis.
+ This signal is emitted when the top x-axis changes to \a axis.
*/
/*!
\qmlsignal BoxPlotSeries::onAxisYRightChanged(AbstractAxis axis)
- Signal is emitted when there is change in Y right axis.
+ This signal is emitted when the right y-axis changes to \a axis.
*/
diff --git a/src/chartsqml2/declarativechart.cpp b/src/chartsqml2/declarativechart.cpp
index 9a5b2678..96f1816a 100644
--- a/src/chartsqml2/declarativechart.cpp
+++ b/src/chartsqml2/declarativechart.cpp
@@ -1113,7 +1113,7 @@ QAbstractAxis *DeclarativeChart::axesAtFunc(QQmlListProperty<QAbstractAxis> *lis
{
if (qobject_cast<DeclarativeChart *>(list->object)) {
DeclarativeChart *chart = qobject_cast<DeclarativeChart *>(list->object);
- QList<QAbstractAxis *> axes = chart->m_chart->axes(Qt::Horizontal | Qt::Vertical, chart->m_chart->series()[0]);
+ QList<QAbstractAxis *> axes = chart->m_chart->axes(Qt::Horizontal | Qt::Vertical);
return axes.at(index);
}
return 0;
diff --git a/src/chartsqml2/declarativechart.h b/src/chartsqml2/declarativechart.h
index 9f249f7c..602e3b2c 100644
--- a/src/chartsqml2/declarativechart.h
+++ b/src/chartsqml2/declarativechart.h
@@ -98,14 +98,14 @@ public:
SeriesTypeBar,
SeriesTypeStackedBar,
SeriesTypePercentBar,
- SeriesTypeBoxPlot,
- SeriesTypeCandlestick,
SeriesTypePie,
SeriesTypeScatter,
SeriesTypeSpline,
SeriesTypeHorizontalBar,
SeriesTypeHorizontalStackedBar,
- SeriesTypeHorizontalPercentBar
+ SeriesTypeHorizontalPercentBar,
+ SeriesTypeBoxPlot,
+ SeriesTypeCandlestick
};
public:
diff --git a/src/chartsqml2/plugins.qmltypes b/src/chartsqml2/plugins.qmltypes
index e4d37386..263f1c5b 100644
--- a/src/chartsqml2/plugins.qmltypes
+++ b/src/chartsqml2/plugins.qmltypes
@@ -323,160 +323,6 @@ Module {
Method { name: "close"; type: "bool" }
}
Component {
- name: "QQuickItem"
- defaultProperty: "data"
- prototype: "QObject"
- Enum {
- name: "TransformOrigin"
- values: {
- "TopLeft": 0,
- "Top": 1,
- "TopRight": 2,
- "Left": 3,
- "Center": 4,
- "Right": 5,
- "BottomLeft": 6,
- "Bottom": 7,
- "BottomRight": 8
- }
- }
- Property { name: "parent"; type: "QQuickItem"; isPointer: true }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
- Property { name: "x"; type: "double" }
- Property { name: "y"; type: "double" }
- Property { name: "z"; type: "double" }
- Property { name: "width"; type: "double" }
- Property { name: "height"; type: "double" }
- Property { name: "opacity"; type: "double" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "visible"; type: "bool" }
- Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
- Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
- Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
- Property { name: "state"; type: "string" }
- Property { name: "childrenRect"; type: "QRectF"; isReadonly: true }
- Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true }
- Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "baselineOffset"; type: "double" }
- Property { name: "clip"; type: "bool" }
- Property { name: "focus"; type: "bool" }
- Property { name: "activeFocus"; type: "bool"; isReadonly: true }
- Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
- Property { name: "rotation"; type: "double" }
- Property { name: "scale"; type: "double" }
- Property { name: "transformOrigin"; type: "TransformOrigin" }
- Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true }
- Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true }
- Property { name: "smooth"; type: "bool" }
- Property { name: "antialiasing"; type: "bool" }
- Property { name: "implicitWidth"; type: "double" }
- Property { name: "implicitHeight"; type: "double" }
- Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true }
- Signal {
- name: "childrenRectChanged"
- Parameter { type: "QRectF" }
- }
- Signal {
- name: "baselineOffsetChanged"
- Parameter { type: "double" }
- }
- Signal {
- name: "stateChanged"
- Parameter { type: "string" }
- }
- Signal {
- name: "focusChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "activeFocusChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "activeFocusOnTabChanged"
- revision: 1
- Parameter { type: "bool" }
- }
- Signal {
- name: "parentChanged"
- Parameter { type: "QQuickItem"; isPointer: true }
- }
- Signal {
- name: "transformOriginChanged"
- Parameter { type: "TransformOrigin" }
- }
- Signal {
- name: "smoothChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "antialiasingChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "clipChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "windowChanged"
- revision: 1
- Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
- }
- Method { name: "update" }
- Method {
- name: "grabToImage"
- revision: 2
- type: "bool"
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "targetSize"; type: "QSize" }
- }
- Method {
- name: "grabToImage"
- revision: 2
- type: "bool"
- Parameter { name: "callback"; type: "QJSValue" }
- }
- Method {
- name: "contains"
- type: "bool"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "mapFromItem"
- Parameter { type: "QQmlV4Function"; isPointer: true }
- }
- Method {
- name: "mapToItem"
- Parameter { type: "QQmlV4Function"; isPointer: true }
- }
- Method { name: "forceActiveFocus" }
- Method {
- name: "forceActiveFocus"
- Parameter { name: "reason"; type: "Qt::FocusReason" }
- }
- Method {
- name: "nextItemInFocusChain"
- revision: 1
- type: "QQuickItem*"
- Parameter { name: "forward"; type: "bool" }
- }
- Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" }
- Method {
- name: "childAt"
- type: "QQuickItem*"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- }
- Component {
name: "QtCharts::DeclarativeAreaSeries"
prototype: "QtCharts::QAreaSeries"
exports: [
@@ -852,6 +698,133 @@ Module {
}
}
Component {
+ name: "QtCharts::DeclarativeCandlestickSeries"
+ defaultProperty: "seriesChildren"
+ prototype: "QtCharts::QCandlestickSeries"
+ exports: ["QtCharts/CandlestickSeries 2.2"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
+ Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
+ Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
+ Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
+ Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "brushFilename"; type: "string" }
+ Signal {
+ name: "axisXChanged"
+ Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
+ }
+ Signal {
+ name: "axisYChanged"
+ Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
+ }
+ Signal {
+ name: "axisXTopChanged"
+ Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
+ }
+ Signal {
+ name: "axisYRightChanged"
+ Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
+ }
+ Signal {
+ name: "clicked"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "hovered"
+ Parameter { name: "status"; type: "bool" }
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "pressed"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "released"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "doubleClicked"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "brushFilenameChanged"
+ Parameter { name: "brushFilename"; type: "string" }
+ }
+ Method {
+ name: "appendSeriesChildren"
+ Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
+ Parameter { name: "element"; type: "QObject"; isPointer: true }
+ }
+ Method {
+ name: "onClicked"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "onHovered"
+ Parameter { name: "status"; type: "bool" }
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "onPressed"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "onReleased"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "onDoubleClicked"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "at"
+ type: "DeclarativeCandlestickSet*"
+ Parameter { name: "index"; type: "int" }
+ }
+ Method {
+ name: "append"
+ type: "bool"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "remove"
+ type: "bool"
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Method {
+ name: "append"
+ type: "bool"
+ Parameter { name: "open"; type: "double" }
+ Parameter { name: "high"; type: "double" }
+ Parameter { name: "low"; type: "double" }
+ Parameter { name: "close"; type: "double" }
+ Parameter { name: "timestamp"; type: "double" }
+ }
+ Method {
+ name: "remove"
+ type: "bool"
+ Parameter { name: "timestamp"; type: "double" }
+ }
+ Method {
+ name: "insert"
+ type: "bool"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "set"; type: "DeclarativeCandlestickSet"; isPointer: true }
+ }
+ Method { name: "clear" }
+ }
+ Component {
+ name: "QtCharts::DeclarativeCandlestickSet"
+ prototype: "QtCharts::QCandlestickSet"
+ exports: ["QtCharts/CandlestickSet 2.2"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "brushFilename"; type: "string" }
+ Signal {
+ name: "brushFilenameChanged"
+ Parameter { name: "brushFilename"; type: "string" }
+ }
+ }
+ Component {
name: "QtCharts::DeclarativeCategoryAxis"
defaultProperty: "axisChildren"
prototype: "QtCharts::QCategoryAxis"
@@ -947,12 +920,13 @@ Module {
"SeriesTypeStackedBar": 3,
"SeriesTypePercentBar": 4,
"SeriesTypeBoxPlot": 5,
- "SeriesTypePie": 6,
- "SeriesTypeScatter": 7,
- "SeriesTypeSpline": 8,
- "SeriesTypeHorizontalBar": 9,
- "SeriesTypeHorizontalStackedBar": 10,
- "SeriesTypeHorizontalPercentBar": 11
+ "SeriesTypeCandlestick": 6,
+ "SeriesTypePie": 7,
+ "SeriesTypeScatter": 8,
+ "SeriesTypeSpline": 9,
+ "SeriesTypeHorizontalBar": 10,
+ "SeriesTypeHorizontalStackedBar": 11,
+ "SeriesTypeHorizontalPercentBar": 12
}
}
Property { name: "theme"; type: "Theme" }
@@ -1020,6 +994,7 @@ Module {
Parameter { name: "curve"; type: "QEasingCurve" }
}
Signal { name: "needRender" }
+ Signal { name: "pendingRenderNodeMouseEventResponses" }
Method {
name: "series"
type: "QAbstractSeries*"
@@ -1985,11 +1960,6 @@ Module {
Property { name: "y"; type: "double" }
}
Component {
- name: "QtCharts::LegendScroller"
- defaultProperty: "children"
- prototype: "QtCharts::QLegend"
- }
- Component {
name: "QtCharts::QAbstractAxis"
prototype: "QObject"
exports: [
@@ -2221,7 +2191,8 @@ Module {
"SeriesTypeHorizontalBar": 8,
"SeriesTypeHorizontalStackedBar": 9,
"SeriesTypeHorizontalPercentBar": 10,
- "SeriesTypeBoxPlot": 11
+ "SeriesTypeBoxPlot": 11,
+ "SeriesTypeCandlestick": 12
}
}
Property { name: "name"; type: "string" }
@@ -2461,6 +2432,82 @@ Module {
Signal { name: "cleared" }
}
Component {
+ name: "QtCharts::QCandlestickModelMapper"
+ prototype: "QObject"
+ exports: ["QtCharts/CandlestickModelMapper 2.2"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
+ Property { name: "series"; type: "QCandlestickSeries"; isPointer: true }
+ Signal { name: "modelReplaced" }
+ Signal { name: "seriesReplaced" }
+ }
+ Component {
+ name: "QtCharts::QCandlestickSeries"
+ prototype: "QtCharts::QAbstractSeries"
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Property { name: "maximumColumnWidth"; type: "double" }
+ Property { name: "minimumColumnWidth"; type: "double" }
+ Property { name: "bodyWidth"; type: "double" }
+ Property { name: "bodyOutlineVisible"; type: "bool" }
+ Property { name: "capsWidth"; type: "double" }
+ Property { name: "capsVisible"; type: "bool" }
+ Property { name: "increasingColor"; type: "QColor" }
+ Property { name: "decreasingColor"; type: "QColor" }
+ Property { name: "brush"; type: "QBrush" }
+ Property { name: "pen"; type: "QPen" }
+ Signal {
+ name: "clicked"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "hovered"
+ Parameter { name: "status"; type: "bool" }
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "pressed"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "released"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "doubleClicked"
+ Parameter { name: "set"; type: "QCandlestickSet"; isPointer: true }
+ }
+ Signal {
+ name: "candlestickSetsAdded"
+ Parameter { name: "sets"; type: "QList<QCandlestickSet*>" }
+ }
+ Signal {
+ name: "candlestickSetsRemoved"
+ Parameter { name: "sets"; type: "QList<QCandlestickSet*>" }
+ }
+ Signal { name: "bodyOutlineVisibilityChanged" }
+ Signal { name: "capsVisibilityChanged" }
+ }
+ Component {
+ name: "QtCharts::QCandlestickSet"
+ prototype: "QObject"
+ Property { name: "timestamp"; type: "double" }
+ Property { name: "open"; type: "double" }
+ Property { name: "high"; type: "double" }
+ Property { name: "low"; type: "double" }
+ Property { name: "close"; type: "double" }
+ Property { name: "brush"; type: "QBrush" }
+ Property { name: "pen"; type: "QPen" }
+ Signal { name: "clicked" }
+ Signal {
+ name: "hovered"
+ Parameter { name: "status"; type: "bool" }
+ }
+ Signal { name: "pressed" }
+ Signal { name: "released" }
+ Signal { name: "doubleClicked" }
+ }
+ Component {
name: "QtCharts::QCategoryAxis"
prototype: "QtCharts::QValueAxis"
Enum {
@@ -2529,6 +2576,33 @@ Module {
Signal { name: "modelReplaced" }
}
Component {
+ name: "QtCharts::QHBoxPlotModelMapper"
+ prototype: "QtCharts::QBoxPlotModelMapper"
+ exports: ["QtCharts/HBoxPlotModelMapper 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "series"; type: "QBoxPlotSeries"; isPointer: true }
+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
+ Property { name: "firstBoxSetRow"; type: "int" }
+ Property { name: "lastBoxSetRow"; type: "int" }
+ Property { name: "firstColumn"; type: "int" }
+ Property { name: "columnCount"; type: "int" }
+ Signal { name: "seriesReplaced" }
+ Signal { name: "modelReplaced" }
+ }
+ Component {
+ name: "QtCharts::QHCandlestickModelMapper"
+ prototype: "QtCharts::QCandlestickModelMapper"
+ exports: ["QtCharts/HCandlestickModelMapper 2.2"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "timestampColumn"; type: "int" }
+ Property { name: "openColumn"; type: "int" }
+ Property { name: "highColumn"; type: "int" }
+ Property { name: "lowColumn"; type: "int" }
+ Property { name: "closeColumn"; type: "int" }
+ Property { name: "firstSetRow"; type: "int" }
+ Property { name: "lastSetRow"; type: "int" }
+ }
+ Component {
name: "QtCharts::QHPieModelMapper"
prototype: "QtCharts::QPieModelMapper"
exports: [
@@ -2585,6 +2659,7 @@ Module {
Property { name: "font"; type: "QFont" }
Property { name: "labelColor"; type: "QColor" }
Property { name: "reverseMarkers"; type: "bool" }
+ Property { name: "showToolTips"; type: "bool" }
Signal {
name: "backgroundVisibleChanged"
Parameter { name: "visible"; type: "bool" }
@@ -2609,6 +2684,10 @@ Module {
name: "reverseMarkersChanged"
Parameter { name: "reverseMarkers"; type: "bool" }
}
+ Signal {
+ name: "showToolTipsChanged"
+ Parameter { name: "showToolTips"; type: "bool" }
+ }
}
Component { name: "QtCharts::QLineSeries"; prototype: "QtCharts::QXYSeries" }
Component {
@@ -2804,6 +2883,19 @@ Module {
Signal { name: "modelReplaced" }
}
Component {
+ name: "QtCharts::QVCandlestickModelMapper"
+ prototype: "QtCharts::QCandlestickModelMapper"
+ exports: ["QtCharts/VCandlestickModelMapper 2.2"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "timestampRow"; type: "int" }
+ Property { name: "openRow"; type: "int" }
+ Property { name: "highRow"; type: "int" }
+ Property { name: "lowRow"; type: "int" }
+ Property { name: "closeRow"; type: "int" }
+ Property { name: "firstSetColumn"; type: "int" }
+ Property { name: "lastSetColumn"; type: "int" }
+ }
+ Component {
name: "QtCharts::QVPieModelMapper"
prototype: "QtCharts::QPieModelMapper"
exports: [
diff --git a/sync.profile b/sync.profile
index c9b8233d..80332926 100644
--- a/sync.profile
+++ b/sync.profile
@@ -6,13 +6,3 @@
%classnames = (
"qchartglobal.h" => "QChartGlobal"
);
-# Module dependencies.
-# Every module that is required to build this module should have one entry.
-# Each of the module version specifiers can take one of the following values:
-# - A specific Git revision.
-# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
-#
-%dependencies = (
- "qtbase" => "",
- "qtdeclarative" => "",
-);
diff --git a/tests/auto/auto.pri b/tests/auto/auto.pri
index a04f5b23..946b0e4a 100644
--- a/tests/auto/auto.pri
+++ b/tests/auto/auto.pri
@@ -2,6 +2,7 @@
error( "Couldn't find the tests.pri file!" )
}
+CONFIG += testcase
QT += testlib widgets
!contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_")
diff --git a/tests/auto/inc/tst_definitions.h b/tests/auto/inc/tst_definitions.h
index e12dac18..a35d53e4 100644
--- a/tests/auto/inc/tst_definitions.h
+++ b/tests/auto/inc/tst_definitions.h
@@ -63,14 +63,16 @@ QT_END_NAMESPACE
#define SKIP_IF_CANNOT_TEST_MOUSE_EVENTS() { \
do { \
QPushButton b; \
- b.resize(100, 100); \
+ b.resize(120, 100); \
b.show(); \
QTest::qWaitForWindowShown(&b); \
QSignalSpy spy(&b, SIGNAL(clicked())); \
QTest::mouseClick(&b, Qt::LeftButton, 0, b.rect().center()); \
+ QApplication::processEvents(); \
if (spy.count() == 0) \
QSKIP("Cannot test mouse events in this environment"); \
} while (0); \
+ QApplication::processEvents(); \
}
#define SKIP_ON_POLAR() { \
@@ -83,6 +85,12 @@ QT_END_NAMESPACE
QSKIP("Test not supported by cartesian chart"); \
}
+// Synthetic mouse moves do not trigger hover events reliably in many virtual machines,
+// so we skip tests involving mouse moves.
+ #define SKIP_IF_FLAKY_MOUSE_MOVE() { \
+ QSKIP("Skipping test with synthetic mouse moves."); \
+ }
+
static inline bool isPolarTest()
{
static bool isPolar = false;
diff --git a/tests/auto/qareaseries/tst_qareaseries.cpp b/tests/auto/qareaseries/tst_qareaseries.cpp
index e03989c0..16fa94b3 100644
--- a/tests/auto/qareaseries/tst_qareaseries.cpp
+++ b/tests/auto/qareaseries/tst_qareaseries.cpp
@@ -78,6 +78,9 @@ void tst_QAreaSeries::init()
m_axisY = new QValueAxis;
m_axisX->setRange(0, 4);
m_axisY->setRange(0, 10);
+ // Hide axes so they don't confuse color checks
+ m_axisX->setVisible(false);
+ m_axisY->setVisible(false);
m_chart->addAxis(m_axisX, Qt::AlignBottom);
m_chart->addAxis(m_axisY, Qt::AlignRight);
}
diff --git a/tests/auto/qbarseries/tst_qbarseries.cpp b/tests/auto/qbarseries/tst_qbarseries.cpp
index 2eb4fe7d..8922af25 100644
--- a/tests/auto/qbarseries/tst_qbarseries.cpp
+++ b/tests/auto/qbarseries/tst_qbarseries.cpp
@@ -627,6 +627,7 @@ void tst_QBarSeries::mousehovered_data()
void tst_QBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QBarSeries* series = new QBarSeries();
diff --git a/tests/auto/qcandlestickseries/tst_qcandlestickseries.cpp b/tests/auto/qcandlestickseries/tst_qcandlestickseries.cpp
index 89686a6f..ac056314 100644
--- a/tests/auto/qcandlestickseries/tst_qcandlestickseries.cpp
+++ b/tests/auto/qcandlestickseries/tst_qcandlestickseries.cpp
@@ -645,6 +645,7 @@ void tst_QCandlestickSeries::mouseClicked()
void tst_QCandlestickSeries::mouseHovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QVERIFY(m_series->append(m_sets));
QCOMPARE(m_series->count(), m_sets.count());
diff --git a/tests/auto/qchartview/tst_qchartview.cpp b/tests/auto/qchartview/tst_qchartview.cpp
index 36b73430..4f36dbc1 100644
--- a/tests/auto/qchartview/tst_qchartview.cpp
+++ b/tests/auto/qchartview/tst_qchartview.cpp
@@ -144,6 +144,9 @@ void tst_QChartView::rubberBand_data()
void tst_QChartView::rubberBand()
{
+ SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
+
QFETCH(QChartView::RubberBands, rubberBand);
QFETCH(int, Xcount);
QFETCH(int, Ycount);
diff --git a/tests/auto/qhorizontalbarseries/tst_qhorizontalbarseries.cpp b/tests/auto/qhorizontalbarseries/tst_qhorizontalbarseries.cpp
index cc6ff8c4..d6e7976b 100644
--- a/tests/auto/qhorizontalbarseries/tst_qhorizontalbarseries.cpp
+++ b/tests/auto/qhorizontalbarseries/tst_qhorizontalbarseries.cpp
@@ -574,6 +574,7 @@ void tst_QHorizontalBarSeries::mousehovered_data()
void tst_QHorizontalBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QHorizontalBarSeries* series = new QHorizontalBarSeries();
diff --git a/tests/auto/qhorizontalpercentbarseries/tst_qhorizontalpercentbarseries.cpp b/tests/auto/qhorizontalpercentbarseries/tst_qhorizontalpercentbarseries.cpp
index da5a149d..c01cb58f 100644
--- a/tests/auto/qhorizontalpercentbarseries/tst_qhorizontalpercentbarseries.cpp
+++ b/tests/auto/qhorizontalpercentbarseries/tst_qhorizontalpercentbarseries.cpp
@@ -321,6 +321,7 @@ void tst_QHorizontalPercentBarSeries::mousehovered_data()
void tst_QHorizontalPercentBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QHorizontalPercentBarSeries* series = new QHorizontalPercentBarSeries();
diff --git a/tests/auto/qhorizontalstackedbarseries/tst_qhorizontalstackedbarseries.cpp b/tests/auto/qhorizontalstackedbarseries/tst_qhorizontalstackedbarseries.cpp
index a95f2aa7..8e5ad06c 100644
--- a/tests/auto/qhorizontalstackedbarseries/tst_qhorizontalstackedbarseries.cpp
+++ b/tests/auto/qhorizontalstackedbarseries/tst_qhorizontalstackedbarseries.cpp
@@ -325,6 +325,7 @@ void tst_QHorizontalStackedBarSeries::mousehovered_data()
void tst_QHorizontalStackedBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QHorizontalStackedBarSeries* series = new QHorizontalStackedBarSeries();
diff --git a/tests/auto/qlegend/tst_qlegend.cpp b/tests/auto/qlegend/tst_qlegend.cpp
index 014c4e0d..605de863 100644
--- a/tests/auto/qlegend/tst_qlegend.cpp
+++ b/tests/auto/qlegend/tst_qlegend.cpp
@@ -506,8 +506,9 @@ void tst_QLegend::xyMarkerPropertiesScatter()
void tst_QLegend::markerSignals()
{
SKIP_ON_POLAR();
-
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
+
QChart *chart = newQChartOrQPolarChart();
QLegend *legend = chart->legend();
diff --git a/tests/auto/qml-qtquicktest/qml-qtquicktest.pro b/tests/auto/qml-qtquicktest/qml-qtquicktest.pro
index d9a1e74f..d4919c1d 100644
--- a/tests/auto/qml-qtquicktest/qml-qtquicktest.pro
+++ b/tests/auto/qml-qtquicktest/qml-qtquicktest.pro
@@ -4,6 +4,7 @@
TEMPLATE = app
CONFIG += warn_on qmltestcase
+CONFIG -= testcase
SOURCES += main.cpp
OTHER_FILES += tst_*.qml
DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
diff --git a/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp b/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp
index b8913bd0..cd16c7e9 100644
--- a/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp
+++ b/tests/auto/qpercentbarseries/tst_qpercentbarseries.cpp
@@ -323,6 +323,7 @@ void tst_QPercentBarSeries::mousehovered_data()
void tst_QPercentBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QPercentBarSeries* series = new QPercentBarSeries();
diff --git a/tests/auto/qpieseries/tst_qpieseries.cpp b/tests/auto/qpieseries/tst_qpieseries.cpp
index 3510332c..022aa5b7 100644
--- a/tests/auto/qpieseries/tst_qpieseries.cpp
+++ b/tests/auto/qpieseries/tst_qpieseries.cpp
@@ -564,6 +564,7 @@ void tst_qpieseries::hoverSignal()
// Just for different signals.
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
// add some slices
m_series->append("slice 1", 1);
@@ -577,13 +578,6 @@ void tst_qpieseries::hoverSignal()
m_view->show();
QTest::qWaitForWindowShown(m_view);
- // try to ensure focus
- QApplication::setActiveWindow(m_view);
- m_view->setFocus();
- QApplication::processEvents();
- QVERIFY(m_view->isActiveWindow());
- QVERIFY(m_view->hasFocus());
-
// move inside the slices
m_series->setPieSize(1.0);
QRectF pieRect = m_view->chart()->plotArea();
diff --git a/tests/auto/qpieslice/tst_qpieslice.cpp b/tests/auto/qpieslice/tst_qpieslice.cpp
index f8eb7841..bc68ddd5 100644
--- a/tests/auto/qpieslice/tst_qpieslice.cpp
+++ b/tests/auto/qpieslice/tst_qpieslice.cpp
@@ -280,6 +280,7 @@ void tst_qpieslice::hoverSignal()
// Just for different signals.
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
// add some slices
QPieSeries *series = new QPieSeries();
diff --git a/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp b/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp
index 8135fdd1..287106cd 100644
--- a/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp
+++ b/tests/auto/qstackedbarseries/tst_qstackedbarseries.cpp
@@ -325,6 +325,7 @@ void tst_QStackedBarSeries::mousehovered_data()
void tst_QStackedBarSeries::mousehovered()
{
SKIP_IF_CANNOT_TEST_MOUSE_EVENTS();
+ SKIP_IF_FLAKY_MOUSE_MOVE();
QStackedBarSeries* series = new QStackedBarSeries();