summaryrefslogtreecommitdiffstats
path: root/src/charts/doc/src/examples-pointsselectionandmarkers.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/doc/src/examples-pointsselectionandmarkers.qdoc')
-rw-r--r--src/charts/doc/src/examples-pointsselectionandmarkers.qdoc76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/charts/doc/src/examples-pointsselectionandmarkers.qdoc b/src/charts/doc/src/examples-pointsselectionandmarkers.qdoc
new file mode 100644
index 00000000..c3fe2e84
--- /dev/null
+++ b/src/charts/doc/src/examples-pointsselectionandmarkers.qdoc
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example pointsselectionandmarkers
+ \title Light Markers Points Selection Example
+ \ingroup qtcharts_examples
+
+ \brief The example shows a usage of light markers
+ and points selection for the series.
+
+ \image examples_pointsselectionandmarkers1.png
+ \image examples_pointsselectionandmarkers2.png
+
+ \include examples-run.qdocinc
+
+ \section1 Light Markers Feature
+
+ We start with creating a series, filling it with the data, and setting up selection funcionality.
+ It's important not to set points visibility to \c true, because light markers functionality is
+ an independent feature and setting both would result in undesired behavior.
+ \snippet pointsselectionandmarkers/main.cpp 1
+
+ Then we create the \c {QChart}, the \c {QChartview} and the control widget with its layout to arrange customization elements.
+ \snippet pointsselectionandmarkers/main.cpp 2
+
+ The next step is creating elements of customization.
+ \snippet pointsselectionandmarkers/main.cpp 3
+
+ We create the label for the marker selection combobox and add fill the combobox with the items.
+ Also, we provide functionality to the combobox. Considering the implementation of the light markers
+ functionality, we need to make sure if displaying of unselected points is checked.
+ Switching the visibility of the light marker off is achieved by setting it to \c "empty" \c {QImage}.
+ If the user unchecks the displaying of unselected points and changes the light marker image, unselected points
+ have to remain invisible.
+ If checking isn't performed, new \c {QImage} will be set for light marker
+ and unselected points will be visible even though it has been switched off.
+ \snippet pointsselectionandmarkers/main.cpp 4
+
+ Almost the same procedure applies to the selected point light marker and line color. The only difference is
+ that there's no need to check visibility of unselected points as it doesn't affect the functionality.
+ \snippet pointsselectionandmarkers/main.cpp 5
+
+ A small difference comes with changing visibility of unselected points. As it was mentioned before,
+ making light markers invisible is achieved by setting them to "empty" \c {QImage}.
+ That is why, depending on checkbox state, selected point light marker is set to "empty" \c {QImage} or
+ to the light marker extracted from the current index of the corresponding combobox.
+ \snippet pointsselectionandmarkers/main.cpp 6
+
+ The final part is to arrange the elements, add all the widgets to the main widget, and set the main window size.
+ \snippet pointsselectionandmarkers/main.cpp 7
+*/