summaryrefslogtreecommitdiffstats
path: root/src/charts/legend/qlegendmarker.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-01-24 13:53:34 +0100
committerLiang Qi <liang.qi@qt.io>2017-01-24 13:53:34 +0100
commite0ba5ac91dbb1fe3611118239c00ea8d748e5678 (patch)
tree6af4ef967b16505dac93557b918b94fcb77c7535 /src/charts/legend/qlegendmarker.cpp
parent1fea2116072f96a86daec092e54fe658651a4034 (diff)
parent7a66c005af12918bde79665659eee3c49f30b650 (diff)
Merge remote-tracking branch 'origin/5.8' into devv5.9.0-alpha1
Conflicts: .qmake.conf src/charts/barchart/qbarset.cpp Change-Id: Id57f9d6ac8cdf996a6bc77780e4a3ee97cae66d6
Diffstat (limited to 'src/charts/legend/qlegendmarker.cpp')
-rw-r--r--src/charts/legend/qlegendmarker.cpp77
1 files changed, 47 insertions, 30 deletions
diff --git a/src/charts/legend/qlegendmarker.cpp b/src/charts/legend/qlegendmarker.cpp
index 6ec29cd9..eb5530c4 100644
--- a/src/charts/legend/qlegendmarker.cpp
+++ b/src/charts/legend/qlegendmarker.cpp
@@ -42,12 +42,13 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\class QLegendMarker
\inmodule Qt Charts
- \brief LegendMarker object.
+ \brief The QLegendMarker class is an abstract object that can be used to access
+ markers within a legend.
- QLegendMarker is abstract object that can be used to access markers inside QLegend. Legend marker consists of two
- items: The colored box, which reflects the color of series and label, which is the name of series (or label of slice/barset
- in case of pie or bar series)
- The QLegendMarker is always related to one series.
+ A legend marker consists of an icon and a label. The icon color corresponds to the color
+ used to draw a series and the label displays the name of the series (or the label of the
+ slice for a pie series or bar set for a bar series). A legend marker is always related to
+ one series, slice, or bar set.
\image examples_percentbarchart_legend.png
@@ -55,37 +56,47 @@ QT_CHARTS_BEGIN_NAMESPACE
*/
/*!
\enum QLegendMarker::LegendMarkerType
+ \since 5.8
- The type of the legendmarker object.
+ The type of the legend marker object.
\value LegendMarkerTypeArea
+ A legend marker for an area series.
\value LegendMarkerTypeBar
+ A legend marker for a bar set.
\value LegendMarkerTypePie
+ A legend marker for a pie slice.
\value LegendMarkerTypeXY
+ A legend marker for a line, spline, or scatter series.
\value LegendMarkerTypeBoxPlot
+ A legend marker for a box plot series.
\value LegendMarkerTypeCandlestick
+ A legend marker for a candlestick series.
*/
/*!
\fn virtual LegendMarkerType QLegendMarker::type() = 0;
- Returns the type of legendmarker. Type depends of the related series. LegendMarkerTypeXY is used for all QXYSeries derived
- classes.
+ Returns the type of the legend marker for the related series, pie slice, or bar set.
+
+ \sa LegendMarkerType
*/
/*!
\fn virtual QAbstractSeries* QLegendMarker::series() = 0;
- Returns pointer to series, which is related to this marker. Marker is always related to some series.
+ Returns a pointer to the series that is related to this legend marker. A legend marker
+ is always related to a series.
*/
/*!
\fn void QLegendMarker::clicked();
- This signal is emitted, when marker is clicked with mouse.
+ This signal is emitted when the legend marker is clicked.
*/
/*!
\fn void QLegendMarker::hovered(bool status);
- This signal is emitted, when mouse is hovered over marker. \a status is true, when mouse enters the marker
- and false when it leaves the marker.
+ This signal is emitted when a mouse is hovered over the legend marker.
+ When the mouse moves over the marker, \a status turns \c true, and when
+ the mouse moves away again, it turns \c false.
*/
/*!
@@ -120,32 +131,34 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\property QLegendMarker::label
- Label of the marker. This is the text that is shown in legend.
+ \brief The text shown in the legend for a legend marker.
*/
/*!
\property QLegendMarker::labelBrush
- Brush of the label
+ \brief The brush of the label.
*/
/*!
\property QLegendMarker::font
- Font of the label
+ \brief The font of the label.
*/
/*!
\property QLegendMarker::pen
- Pen of the marker. This is the outline of the colored square.
+ \brief The pen used to draw the outline of the icon.
*/
/*!
\property QLegendMarker::brush
- Brush of the marker. This is the inside of the colored square.
+ \brief The brush used to fill the icon.
*/
/*!
\property QLegendMarker::visible
- Visibility of the legend marker. Affects label and the colored square.
+ \brief The visibility of the legend marker.
+
+ The visibility affects both the legend marker label and the icon.
*/
/*!
@@ -166,7 +179,7 @@ QLegendMarker::QLegendMarker(QLegendMarkerPrivate &d, QObject *parent) :
}
/*!
- Destructor of marker
+ Removes the legend marker.
*/
QLegendMarker::~QLegendMarker()
{
@@ -181,7 +194,9 @@ QString QLegendMarker::label() const
}
/*!
- Sets the \a label of marker. Note that changing name of series will also change label of its marker.
+ Sets the label of the marker to \a label.
+
+ \note Changing the name of a series also changes the label of its marker.
*/
void QLegendMarker::setLabel(const QString &label)
{
@@ -193,7 +208,7 @@ void QLegendMarker::setLabel(const QString &label)
}
}
/*!
- Returns the brush which is used to draw label.
+ Returns the brush that is used to draw the label.
*/
QBrush QLegendMarker::labelBrush() const
{
@@ -201,7 +216,7 @@ QBrush QLegendMarker::labelBrush() const
}
/*!
- Sets the \a brush of label
+ Sets the the brush used to draw to label to \a brush.
*/
void QLegendMarker::setLabelBrush(const QBrush &brush)
{
@@ -209,7 +224,7 @@ void QLegendMarker::setLabelBrush(const QBrush &brush)
}
/*!
- Retuns the font of label
+ Retuns the font of the label.
*/
QFont QLegendMarker::font() const
{
@@ -217,7 +232,7 @@ QFont QLegendMarker::font() const
}
/*!
- Sets the \a font of label
+ Sets the font of the label to \a font.
*/
void QLegendMarker::setFont(const QFont &font)
{
@@ -225,7 +240,7 @@ void QLegendMarker::setFont(const QFont &font)
}
/*!
- Returns the pen of marker item
+ Returns the pen used to draw the outline of the icon.
*/
QPen QLegendMarker::pen() const
{
@@ -233,7 +248,7 @@ QPen QLegendMarker::pen() const
}
/*!
- Sets the \a pen of marker item
+ Sets the \a pen used to draw the outline of the icon to \a pen.
*/
void QLegendMarker::setPen(const QPen &pen)
{
@@ -246,7 +261,7 @@ void QLegendMarker::setPen(const QPen &pen)
}
/*!
- Returns the brush of marker item
+ Returns the brush used to fill the icon.
*/
QBrush QLegendMarker::brush() const
{
@@ -254,7 +269,9 @@ QBrush QLegendMarker::brush() const
}
/*!
- Sets the \a brush of marker item. Note that changing color of the series also changes this.
+ Sets the brush used to fill the icon to \a brush.
+
+ \note Changing the color of the series also changes the color of the icon.
*/
void QLegendMarker::setBrush(const QBrush &brush)
{
@@ -267,7 +284,7 @@ void QLegendMarker::setBrush(const QBrush &brush)
}
/*!
- Returns visibility of the marker
+ Returns the visibility of the marker.
*/
bool QLegendMarker::isVisible() const
{
@@ -275,7 +292,7 @@ bool QLegendMarker::isVisible() const
}
/*!
- Sets markers visibility to \a visible
+ Sets the marker's visibility to \a visible.
*/
void QLegendMarker::setVisible(bool visible)
{