QLegendData: Properly expose it to QML

Also, fix the docs to correctly mark it as a value type.

Pick-to: 6.10
Change-Id: I68405ba4b0c32b0d9c84b0913031e5e124de1bc0
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fabian Kosmale 2025-05-21 18:20:56 +02:00
parent 7575bff47e
commit 1b5faeddc4
2 changed files with 7 additions and 2 deletions

View File

@ -42,15 +42,18 @@ QT_BEGIN_NAMESPACE
*/
/*!
\qmltype LegendData
\qmlvaluetype legendData
\nativetype QLegendData
\inqmlmodule QtGraphs
\ingroup graphs_qml__2D
\brief The LegendData struct contains information to display on a sets
\brief The legendData value type contains information to display on a sets
legend marker.
The information needed to make a visual association between a set and a
marker include properties such as color, border color, and a name of a set.
\note Before Qt 6.10, this value type was only provided as an anonymous
type.
*/
/*!

View File

@ -19,6 +19,8 @@ class QGraphsView;
struct Q_GRAPHS_EXPORT QLegendData
{
Q_GADGET
QML_VALUE_TYPE(legendData)
QML_ADDED_IN_VERSION(6, 10) // formerly anonymous
Q_PROPERTY(QColor color MEMBER color FINAL)
Q_PROPERTY(QColor borderColor MEMBER borderColor FINAL)
Q_PROPERTY(QString label MEMBER label FINAL)