From eb7bca1edcdd229b92c5d013847492a882194e1f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 23 Feb 2021 09:28:05 +0100 Subject: Only create the GLXYSeriesData if there is no existing data This ensures that there is no memory leak due to unnecessary creation of the GLXYSeriesData when setting the series data. Change-Id: Iec7966bbbf53e595ead780462c89bb3e1205854e Reviewed-by: Miikka Heikkinen (cherry picked from commit eaf63689403df7f122591795d80ef126b8fb5eaa) Reviewed-by: Qt Cherry-pick Bot --- src/chartsqml2/declarativeopenglrendernode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chartsqml2/declarativeopenglrendernode.cpp b/src/chartsqml2/declarativeopenglrendernode.cpp index 6d2baf20..013cbe4f 100644 --- a/src/chartsqml2/declarativeopenglrendernode.cpp +++ b/src/chartsqml2/declarativeopenglrendernode.cpp @@ -229,7 +229,8 @@ void DeclarativeOpenGLRenderNode::setSeriesData(bool mapDirty, const GLXYDataMap GLXYSeriesData *data = oldMap.take(i.key()); const GLXYSeriesData *newData = i.value(); if (!data || newData->dirty) { - data = new GLXYSeriesData; + if (!data) + data = new GLXYSeriesData; *data = *newData; } m_xyDataMap.insert(i.key(), data); -- cgit v1.2.3 From 044275ad2b4cf5ccd0bef968237ecf8fc731633a Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 1 Mar 2021 22:35:30 +0100 Subject: Doc: Fix issues in Q[H|V]XYModelMapper documentation * The detailed description for these two types were swapped * Clarify the data model used for the mapper, and suggest a table model as a good fit * Link to the example that makes use of a mapper Fixes: QTBUG-80828 Change-Id: If45dce47e74c28eb76d248133bbbfd2e44555750 Reviewed-by: Miikka Heikkinen Reviewed-by: Leena Miettinen (cherry picked from commit ef331c506ab960d2a6e22c17c4af199b1079ef73) Reviewed-by: Qt Cherry-pick Bot --- src/charts/xychart/qhxymodelmapper.cpp | 12 ++++++++---- src/charts/xychart/qvxymodelmapper.cpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/charts/xychart/qhxymodelmapper.cpp b/src/charts/xychart/qhxymodelmapper.cpp index 083dc03c..de5cca82 100644 --- a/src/charts/xychart/qhxymodelmapper.cpp +++ b/src/charts/xychart/qhxymodelmapper.cpp @@ -40,12 +40,14 @@ QT_CHARTS_BEGIN_NAMESPACE Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A horizontal model mapper is used to create a connection between a line, spline, or scatter series and the data - model that holds the consecutive data point coordinates on rows. + model that has \e X and \e Y rows for the coordinates and holds the data + points for the XYSeries as columns. A \e TableModel is a natural choice + for the model. Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync. - \sa QVXYModelMapper, QXYSeries + \sa QVXYModelMapper, QXYSeries, {Model Data Example} */ /*! \qmltype HXYModelMapper @@ -57,12 +59,14 @@ QT_CHARTS_BEGIN_NAMESPACE Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A horizontal model mapper is used to create a connection between a line, spline, or scatter series and the data - model that holds the consecutive data point coordinates on rows. + model that has \e X and \e Y rows for the coordinates and holds the data + points for the XYSeries as columns. A \e TableModel is a natural choice + for the model. Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync. - \sa VXYModelMapper, XYSeries + \sa VXYModelMapper, XYSeries, {Model Data Example} */ /*! diff --git a/src/charts/xychart/qvxymodelmapper.cpp b/src/charts/xychart/qvxymodelmapper.cpp index ff9a4f21..71ae79ce 100644 --- a/src/charts/xychart/qvxymodelmapper.cpp +++ b/src/charts/xychart/qvxymodelmapper.cpp @@ -40,12 +40,14 @@ QT_CHARTS_BEGIN_NAMESPACE Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A vertical model mapper is used to create a connection between a line, spline, or scatter series and the data - model that holds the consecutive data point coordinates in columns. + model that has \e X and \e Y columns for the coordinates and holds the data + points for the XYSeries as rows. A \e TableModel is a natural choice + for the model. Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync. - \sa QHXYModelMapper, QXYSeries + \sa QHXYModelMapper, QXYSeries, {Model Data Example} */ /*! \qmltype VXYModelMapper @@ -57,12 +59,14 @@ QT_CHARTS_BEGIN_NAMESPACE Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A vertical model mapper is used to create a connection between a line, spline, or scatter series and the data - model that holds the consecutive data point coordinates in columns. + model that has \e X and \e Y columns for the coordinates and holds the data + points for the XYSeries as rows. A \e TableModel is a natural choice + for the model. Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync. - \sa HXYModelMapper, XYSeries + \sa HXYModelMapper, XYSeries, {Model Data Example} */ /*! -- cgit v1.2.3 From 7b3987d9b000325728e4e94af3c58af52589f445 Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Wed, 3 Mar 2021 15:06:56 +0200 Subject: Bump version Change-Id: Ib00958df8e689eec10eb1f4e7fbf4b2b2c09e47e --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 05561703..7dc754c7 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.3 +MODULE_VERSION = 5.15.4 -- cgit v1.2.3