diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-04-02 12:16:05 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-04-03 09:27:54 +0300 |
commit | aaf51bfad10e0eac7a8ee64e36aab5f0c1119468 (patch) | |
tree | bd20d2ec028bf1acfe4dd418b3a639b17f75b591 /examples/datavisualization/qmloscilloscope/doc/src | |
parent | e076fa05488bb9f58393f0e636c97d07b6fb446d (diff) |
Enable querying selection label via API
Also enable suppressing drawing the label on graph.
Selection label formatting was consequently moved from renderers
to series.
Task-number: QTRD-2896
Change-Id: Ia6a1a40298d8db0f54349de3eb27fb0b683dd302
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization/qmloscilloscope/doc/src')
-rw-r--r-- | examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc index c574950b..93bd5c30 100644 --- a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc +++ b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc @@ -59,11 +59,6 @@ we still need to call QSurfaceDataProxy::resetArray() after changing the data in it to prompt the graph to render the data. - The final method, \c selectionLabel(), is used to generate a label string we can show on the - QML ui. This method utilizes the axis formats to format the label: - - \snippet qmloscilloscope/datasource.cpp 2 - To be able to access the \c DataSource methods from QML, we need to expose it. We do this by defining a context property in application main: @@ -86,15 +81,11 @@ One interesting detail is that we don't specify a proxy for the Surface3DSeries we attach to the graph. This makes the series to utilize the default QSurfaceDataProxy. - We also specify an empty string for \l{Abstract3DSeries::itemLabelFormat}{itemLabelFormat}, since we want to display - the selected item information in a \c Text element instead of a label above the selection pointer. + We also hide the item label with \l{Abstract3DSeries::itemLabelVisible}{itemLabelFormat}, since + we want to display the selected item information in a \c Text element instead of a floating + label above the selection pointer. This is done because the selection pointer moves around a lot as the data changes, which makes the regular selection label difficult to read. - When selection point changes, we update the label text using a helper function - \c updateSelectionLabel(), which calls one of the methods we defined for our \c DataSource class - to obtain the label: - - \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 1 We initialize the \c DataSource cache when the graph is complete by calling a helper function \c generateData(), which calls the method with the same name on the \c DataSource: |