From 98a5c5ffbaab2879b9b3443561cf13af24097f13 2012-12-10 10:35:46 From: Tero Ahola Date: 2012-12-10 10:35:46 Subject: [PATCH] Documented QXYSeries::hovered and QAreaSeries::hovered --- diff --git a/src/areachart/qareaseries.cpp b/src/areachart/qareaseries.cpp index 18f852e..be6e605 100644 --- a/src/areachart/qareaseries.cpp +++ b/src/areachart/qareaseries.cpp @@ -142,6 +142,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \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. +*/ +/*! + \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. +*/ + +/*! \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. diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index 08cfa4b..f3e8960 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -117,6 +117,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \fn void QXYSeries::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. +*/ +/*! + \qmlsignal XYSeries::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. +*/ + +/*! \fn void QXYSeries::pointReplaced(int index) Signal is emitted when a point has been replaced at \a index. \sa replace() diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml index bdb80c2..bead3c5 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml @@ -31,7 +31,7 @@ ChartView { AreaSeries { id: areaSeries name: "area 1" - + upperSeries: LineSeries { XYPoint { x: 0; y: 1 } XYPoint { x: 1; y: 1 } @@ -70,6 +70,7 @@ ChartView { onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor); onBorderWidthChanged: console.log(name + ".onBorderChanged: " + borderWidth); // onCountChanged: console.log(name + ".onCountChanged: " + count); + onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); } AreaSeries { diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml index 698451d..df68dcf 100644 --- a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml +++ b/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml @@ -51,6 +51,7 @@ ChartView { onStyleChanged: console.log("lineSeries.onStyleChanged: " + style); onCapStyleChanged: console.log("lineSeries.onCapStyleChanged: " + capStyle); onCountChanged: console.log("lineSeries.onCountChanged: " + count); + onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); } LineSeries {