From aaf51bfad10e0eac7a8ee64e36aab5f0c1119468 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 2 Apr 2014 12:16:05 +0300 Subject: Enable querying selection label via API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ää --- .../qmloscilloscope/doc/src/qmloscilloscope.qdoc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'examples/datavisualization/qmloscilloscope/doc/src') 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: -- cgit v1.2.3