Merge remote-tracking branch 'origin/5.6' into 5.7

Conflicts:
	src/charts/glwidget.cpp
	src/charts/xychart/glxyseriesdata_p.h
	src/chartsqml2/declarativerendernode.cpp

Change-Id: I611ff3a7874ceb7dddcf0f4d069927a9899a986d
This commit is contained in:
Liang Qi 2016-08-10 17:48:55 +02:00
commit a7b80c0b61
63 changed files with 592 additions and 425 deletions

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = areachart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/areachart
INSTALLS += target

View File

@ -1,15 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts multimedia
QT += multimedia
HEADERS += \
widget.h \
xyseriesiodevice.h
TARGET = audio
TEMPLATE = app
SOURCES += main.cpp\
SOURCES += \
main.cpp\
widget.cpp \
xyseriesiodevice.cpp
HEADERS += widget.h \
xyseriesiodevice.h
target.path = $$[QT_INSTALL_EXAMPLES]/charts/audio
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = barchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/barchart
INSTALLS += target

View File

@ -1,16 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
QT += core gui
HEADERS += \
customtablemodel.h \
tablewidget.h
TARGET = barmodelmapper
TEMPLATE = app
SOURCES += \
customtablemodel.cpp \
main.cpp \
tablewidget.cpp
SOURCES += main.cpp\
tablewidget.cpp \
customtablemodel.cpp
HEADERS += tablewidget.h \
customtablemodel.h
target.path = $$[QT_INSTALL_EXAMPLES]/charts/barmodelmapper
INSTALLS += target

View File

@ -1,13 +1,14 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = boxplotchart
SOURCES += main.cpp \
boxdatareader.cpp
HEADERS += \
boxdatareader.h
SOURCES += \
boxdatareader.cpp \
main.cpp \
RESOURCES += \
boxplotdata.qrc
HEADERS += \
boxdatareader.h
target.path = $$[QT_INSTALL_EXAMPLES]/charts/boxplotchart
INSTALLS += target

View File

@ -1,15 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = callout
TEMPLATE = app
SOURCES += \
main.cpp\
callout.cpp \
view.cpp
QT += charts
HEADERS += \
callout.h \
view.h
SOURCES += \
callout.cpp \
main.cpp\
view.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/callout
INSTALLS += target

View File

@ -1,11 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
QT += core gui
HEADERS += \
chart.h \
chartview.h
TARGET = chartinteractions
TEMPLATE = app
SOURCES += \
chart.cpp \
chartview.cpp \
main.cpp
HEADERS += chart.h chartview.h
SOURCES += main.cpp chart.cpp chartview.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/chartinteractions
INSTALLS += target

View File

@ -1,50 +1,53 @@
TEMPLATE = subdirs
SUBDIRS += areachart \
SUBDIRS += \
areachart \
barchart \
barmodelmapper \
boxplotchart \
callout \
chartinteractions \
chartthemes \
customchart \
donutbreakdown \
donutchart \
dynamicspline \
horizontalbarchart \
horizontalpercentbarchart \
horizontalstackedbarchart \
legend \
legendmarkers \
lineandbar \
linechart \
logvalueaxis \
modeldata \
multiaxis \
nesteddonuts \
percentbarchart \
piechart \
piechartcustomization \
piechartdrilldown \
polarchart \
scatterchart \
scatterinteractions \
splinechart \
stackedbarchart \
stackedbarchartdrilldown \
zoomlinechart \
modeldata \
barchart \
boxplotchart \
legend \
barmodelmapper \
lineandbar \
horizontalbarchart \
horizontalstackedbarchart \
horizontalpercentbarchart \
donutbreakdown \
temperaturerecords \
donutchart \
multiaxis \
legendmarkers \
logvalueaxis \
polarchart \
piechartcustomization \
dynamicspline \
nesteddonuts \
chartinteractions \
callout \
chartthemes
zoomlinechart
qtHaveModule(quick) {
SUBDIRS += qmlboxplot \
qmlpiechart \
qmlweather \
qmlf1legends \
qmlcustomizations \
SUBDIRS += \
qmlaxes \
qmlcustomlegend \
qmlpolarchart \
qmlboxplot \
qmlchart \
qmloscilloscope
qmlcustomizations \
qmlcustomlegend \
qmlf1legends \
qmloscilloscope \
qmlpiechart \
qmlpolarchart \
qmlweather
}
qtHaveModule(multimedia) {

View File

@ -1,7 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = chartthemes
SOURCES = main.cpp themewidget.cpp
HEADERS = themewidget.h
HEADERS += \
themewidget.h
SOURCES += \
main.cpp \
themewidget.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/chartthemes
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = customchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/customchart
INSTALLS += target

View File

@ -1,8 +1,10 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = datetimeaxis
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
RESOURCES += \
sundata.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/charts/datetimeaxis
INSTALLS += target

View File

@ -1,12 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = donutbreakdown
SOURCES += main.cpp\
donutbreakdownchart.cpp \
mainslice.cpp
QT += charts
HEADERS += \
donutbreakdownchart.h \
mainslice.h
SOURCES += \
donutbreakdownchart.cpp \
main.cpp \
mainslice.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/donutbreakdown
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = donutchart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/donutchart
INSTALLS += target

View File

@ -1,7 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = dynamicspline
HEADERS += chart.h
SOURCES += main.cpp chart.cpp
HEADERS += \
chart.h
SOURCES += \
chart.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/dynamicspline
INSTALLS += target

View File

@ -1,17 +0,0 @@
INCLUDEPATH += ../../../include
LIBS += -L$$OUT_PWD/../../../lib
TEMPLATE = app
QT += charts
QT += core gui widgets
contains(TARGET, qml.*) {
QT += qml quick
}
target.path = $$[QT_INSTALL_EXAMPLES]/charts/$$TARGET
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = horizontalbarchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/horizontalbarchart
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = horizontalpercentbarchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/horizontalpercentbarchart
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = horizontalstackedbarchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/horizontalstackedbarchart
INSTALLS += target

View File

@ -1,10 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = legend
SOURCES += main.cpp \
mainwidget.cpp
QT += charts
HEADERS += \
mainwidget.h
SOURCES += \
main.cpp \
mainwidget.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/legend
INSTALLS += target

View File

@ -1,10 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = legendmarkers
SOURCES += main.cpp \
mainwidget.cpp
QT += charts
HEADERS += \
mainwidget.h
SOURCES += \
main.cpp \
mainwidget.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/legendmarkers
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = lineandbar
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/lineandbar
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = linechart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/linechart
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = logvalueaxis
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/logvalueaxis
INSTALLS += target

View File

@ -1,16 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
QT += core gui
HEADERS += \
customtablemodel.h \
tablewidget.h
TARGET = modeldata
TEMPLATE = app
SOURCES += \
customtablemodel.cpp \
main.cpp \
tablewidget.cpp
SOURCES += main.cpp\
tablewidget.cpp \
customtablemodel.cpp
HEADERS += tablewidget.h \
customtablemodel.h
target.path = $$[QT_INSTALL_EXAMPLES]/charts/modeldata
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = multiaxis
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/multiaxis
INSTALLS += target

View File

@ -1,8 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = nesteddonuts
SOURCES += main.cpp\
HEADERS += \
widget.h
SOURCES += \
main.cpp \
widget.cpp
HEADERS += widget.h
target.path = $$[QT_INSTALL_EXAMPLES]/charts/nesteddonuts
INSTALLS += target

View File

@ -1,9 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = openglseries
SOURCES += main.cpp \
datasource.cpp
HEADERS += datasource.h
HEADERS += \
datasource.h
SOURCES += \
datasource.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/openglseries
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = percentbarchart
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/percentbarchart
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = piechart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/piechart
INSTALLS += target

View File

@ -1,16 +1,17 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = piechartcustomization
SOURCES += main.cpp \
pentool.cpp \
brushtool.cpp \
customslice.cpp \
mainwidget.cpp
QT += charts
HEADERS += \
pentool.h \
brushtool.h \
customslice.h \
mainwidget.h
mainwidget.h \
pentool.h
SOURCES += \
brushtool.cpp \
customslice.cpp \
main.cpp \
mainwidget.cpp \
pentool.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/piechartcustomization
INSTALLS += target

View File

@ -1,11 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = piechartdrilldown
SOURCES += main.cpp \
drilldownslice.cpp \
drilldownchart.cpp
QT += charts
HEADERS += \
drilldownchart.h \
drilldownslice.h
SOURCES += \
drilldownchart.cpp \
drilldownslice.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/piechartdrilldown
INSTALLS += target

View File

@ -1,6 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = polarchart
SOURCES += main.cpp chartview.cpp
HEADERS += chartview.h
QT += charts
HEADERS += \
chartview.h
SOURCES += \
chartview.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/polarchart
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlaxes/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlaxes/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlaxes
INSTALLS += target

View File

@ -1,9 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
SOURCES += \
main.cpp
OTHER_FILES += \
qml/qmlboxplot/main.qml
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlboxplot/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlboxplot
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlchart/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlchart/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlchart
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlcustomizations/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlcustomizations/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlcustomizations
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlcustomlegend/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlcustomlegend/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlcustomlegend
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlf1legends/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlf1legends/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlf1legends
INSTALLS += target

View File

@ -1,11 +1,17 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
RESOURCES += resources.qrc
SOURCES += main.cpp \
datasource.cpp
OTHER_FILES += qml/qmloscilloscope/*
QT += charts qml quick
HEADERS += \
datasource.h
SOURCES += \
main.cpp \
datasource.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmloscilloscope/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmloscilloscope
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlpiechart/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlpiechart/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlpiechart
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlpolarchart/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlpolarchart/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlpolarchart
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts qml quick
RESOURCES += resources.qrc
SOURCES += main.cpp
OTHER_FILES += qml/qmlweather/*
SOURCES += \
main.cpp
RESOURCES += \
resources.qrc
DISTFILES += \
qml/qmlweather/*
target.path = $$[QT_INSTALL_EXAMPLES]/charts/qmlweather
INSTALLS += target

View File

@ -1,9 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = scatterchart
SOURCES += main.cpp \
chartview.cpp
QT += charts
HEADERS += \
chartview.h
SOURCES += \
chartview.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/scatterchart
INSTALLS += target

View File

@ -1,9 +1,11 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = scatterinteractions
SOURCES += main.cpp \
chartview.cpp
HEADERS += \
chartview.h
SOURCES += \
chartview.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/scatterinteractions
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = splinechart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/splinechart
INSTALLS += target

View File

@ -1,5 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = stackedbarchart
SOURCES += main.cpp
QT += charts
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/stackedbarchart
INSTALLS += target

View File

@ -1,6 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = stackedbarchartdrilldown
SOURCES += main.cpp drilldownseries.cpp drilldownchart.cpp
HEADERS += drilldownseries.h drilldownchart.h
QT += charts
HEADERS += \
drilldownchart.h \
drilldownseries.h
SOURCES += \
drilldownchart.cpp \
drilldownseries.cpp \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/stackedbarchartdrilldown
INSTALLS += target

View File

@ -1,6 +1,7 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
QT += charts
TARGET = temperaturerecords
SOURCES += main.cpp
SOURCES += \
main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/temperaturerecords
INSTALLS += target

View File

@ -1,7 +1,13 @@
!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}
TARGET = zoomlinechart
HEADERS += chart.h chartview.h
QT += charts
SOURCES += main.cpp chart.cpp chartview.cpp
HEADERS += \
chart.h \
chartview.h
SOURCES += \
main.cpp \
chart.cpp \
chartview.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/charts/zoomlinechart
INSTALLS += target

View File

@ -280,12 +280,19 @@ QT_CHARTS_BEGIN_NAMESPACE
/*!
\qmlproperty QVariantList BarSet::values
The values of the bar set. You can set either a list of reals or a list of points as values. If you set a list of
reals as values, the values are automatically completed to points by using the index of a value as it's
x-coordinate. For example the following sets have equal values:
The values of the bar set. You can set either a list of reals or a list of points as values.
If you set a list of reals as values, the values directly define the bar set values.
If you set a list of points as values, the x-coordinate of the point specifies its zero-based
index in the bar set. The size of the bar set is the highest x-coordinate value + 1.
If a point is missing for any x-coordinate between zero and the highest value,
it gets value zero.
For example the following sets have equal values:
\code
myBarSet1.values = [0, 5, 1, 5];
myBarSet2.values = [Qt.point(0, 0), Qt.point(1, 5), Qt.point(2, 1), Qt.point(3, 5)];
myBarSet1.values = [5, 0, 1, 5];
myBarSet2.values = [Qt.point(0, 5), Qt.point(2, 1), Qt.point(3, 5)];
\endcode
*/

View File

@ -178,6 +178,7 @@ void GLWidget::paintGL()
QOpenGLBuffer *vbo = m_seriesBufferMap.value(i.key());
GLXYSeriesData *data = i.value();
if (data->visible) {
m_program->setUniformValue(m_colorUniformLoc, data->color);
m_program->setUniformValue(m_minUniformLoc, data->min);
m_program->setUniformValue(m_deltaUniformLoc, data->delta);
@ -204,6 +205,7 @@ void GLWidget::paintGL()
}
vbo->release();
}
}
#ifdef QDEBUG_TRACE_GL_FPS
static QElapsedTimer stopWatch;

View File

@ -233,11 +233,11 @@ QRectF CartesianChartLayout::calculateAxisMinimum(const QRectF &minimum, const Q
switch (axis->axis()->alignment()) {
case Qt::AlignLeft:
left.setWidth(left.width() + size.width());
left.setHeight(qMax(left.height() * 2, size.height()));
left.setHeight(qMax(left.height(), size.height()));
break;
case Qt::AlignRight:
right.setWidth(right.width() + size.width());
right.setHeight(qMax(right.height() * 2, size.height()));
right.setHeight(qMax(right.height(), size.height()));
break;
case Qt::AlignTop:
top.setWidth(qMax(top.width(), size.width()));

View File

@ -347,6 +347,7 @@ void LineChartItem::handleUpdated()
bool doGeometryUpdate =
(m_pointsVisible != m_series->pointsVisible())
|| (m_series->pointsVisible() && (m_linePen != m_series->pen()));
bool visibleChanged = m_series->isVisible() != isVisible();
setVisible(m_series->isVisible());
setOpacity(m_series->opacity());
m_pointsVisible = m_series->pointsVisible();
@ -358,6 +359,8 @@ void LineChartItem::handleUpdated()
m_pointLabelsClipping = m_series->pointLabelsClipping();
if (doGeometryUpdate)
updateGeometry();
else if (m_series->useOpenGL() && visibleChanged)
refreshGlChart();
update();
}

View File

@ -256,15 +256,21 @@ void ScatterChartItem::setBrush(const QBrush &brush)
void ScatterChartItem::handleUpdated()
{
int count = m_items.childItems().count();
if (m_series->useOpenGL()) {
if ((m_series->isVisible() != m_visible)) {
m_visible = m_series->isVisible();
refreshGlChart();
}
return;
}
int count = m_items.childItems().count();
if (count == 0)
return;
bool recreate = m_visible != m_series->isVisible()
|| m_size != m_series->markerSize()
|| m_shape != m_series->markerShape();
m_visible = m_series->isVisible();
m_size = m_series->markerSize();
m_shape = m_series->markerShape();

View File

@ -50,6 +50,7 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
if (!data) {
data = new GLXYSeriesData;
data->type = series->type();
data->visible = series->isVisible();
QColor sc;
if (data->type == QAbstractSeries::SeriesTypeScatter) {
QScatterSeries *scatter = static_cast<QScatterSeries *>(series);
@ -68,6 +69,8 @@ void GLXYSeriesDataManager::setPoints(QXYSeries *series, const AbstractDomain *d
data->color = QVector3D(float(sc.redF()), float(sc.greenF()), float(sc.blueF()));
connect(series, &QXYSeries::useOpenGLChanged, this,
&GLXYSeriesDataManager::handleSeriesOpenGLChange);
connect(series, &QXYSeries::visibleChanged, this,
&GLXYSeriesDataManager::handleSeriesVisibilityChange);
m_seriesDataMap.insert(series, data);
m_mapDirty = true;
}
@ -174,6 +177,18 @@ void GLXYSeriesDataManager::handleSeriesOpenGLChange()
removeSeries(series);
}
void GLXYSeriesDataManager::handleSeriesVisibilityChange()
{
QXYSeries *series = qobject_cast<QXYSeries *>(sender());
if (series) {
GLXYSeriesData *data = m_seriesDataMap.value(series);
if (data) {
data->visible = series->isVisible();
data->dirty = true;
}
}
}
void GLXYSeriesDataManager::handleScatterColorChange()
{
QScatterSeries *series = qobject_cast<QScatterSeries *>(sender());

View File

@ -58,6 +58,7 @@ struct GLXYSeriesData {
QAbstractSeries::SeriesType type;
QVector2D min;
QVector2D delta;
bool visible;
QMatrix4x4 matrix;
public:
GLXYSeriesData &operator=(const GLXYSeriesData &data) {
@ -68,6 +69,7 @@ public:
type = data.type;
min = data.min;
delta = data.delta;
visible = data.visible;
matrix = data.matrix;
return *this;
}
@ -103,6 +105,7 @@ public Q_SLOTS:
void cleanup();
void handleSeriesPenChange();
void handleSeriesOpenGLChange();
void handleSeriesVisibilityChange();
void handleScatterColorChange();
void handleScatterMarkerSizeChange();

View File

@ -120,7 +120,7 @@ QT_CHARTS_BEGIN_NAMESPACE
Minimal and default value is: -1 (count limited by the number of rows in the model)
*/
/*!
\qmlproperty int VXYModelMapper::columnCount
\qmlproperty int VXYModelMapper::rowCount
Defines the number of rows of the model that are mapped as the data for series. The default value is
-1 (count limited by the number of rows in the model).
*/

View File

@ -32,6 +32,7 @@
#include <QtCharts/QXYSeries>
#include <QtCore/QAbstractItemModel>
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
QT_CHARTS_BEGIN_NAMESPACE
@ -544,6 +545,8 @@ void QXYModelMapperPrivate::initializeXYFromModel()
int pointPos = 0;
QModelIndex xIndex = xModelIndex(pointPos);
QModelIndex yIndex = yModelIndex(pointPos);
if (xIndex.isValid() && yIndex.isValid()) {
while (xIndex.isValid() && yIndex.isValid()) {
QPointF point;
point.setX(valueFromModel(xIndex));
@ -552,7 +555,17 @@ void QXYModelMapperPrivate::initializeXYFromModel()
pointPos++;
xIndex = xModelIndex(pointPos);
yIndex = yModelIndex(pointPos);
// Don't warn about invalid index after the first, those are valid and used to
// determine when we should end looping.
}
} else {
// Invalid index right off the bat means series will be left empty, so output a warning
if (!xIndex.isValid())
qWarning() << __FUNCTION__ << QStringLiteral("Invalid X coordinate index in model mapper.");
else if (!yIndex.isValid())
qWarning() << __FUNCTION__ << QStringLiteral("Invalid Y coordinate index in model mapper.");
}
blockSeriesSignals(false);
}

View File

@ -126,6 +126,12 @@ void XYChart::updateGlChart()
updateGeometry();
}
// Doesn't update gl geometry, but refreshes the chart
void XYChart::refreshGlChart()
{
presenter()->updateGLWidget();
}
//handlers
void XYChart::handlePointAdded(int index)

View File

@ -88,6 +88,7 @@ Q_SIGNALS:
protected:
virtual void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index = -1);
virtual void updateGlChart();
virtual void refreshGlChart();
private:
inline bool isEmpty();

View File

@ -87,12 +87,12 @@ void DeclarativeBarSet::setValues(QVariantList values)
}
}
QVector<int> indexValueList;
QVector<qreal> indexValueList;
indexValueList.resize(maxValue + 1);
for (int i = 0; i < values.count(); i++) {
if (values.at(i).canConvert(QVariant::Point)) {
indexValueList.replace(values.at(i).toPoint().x(), values.at(i).toPoint().y());
indexValueList.replace(values.at(i).toPoint().x(), values.at(i).toPointF().y());
}
}

View File

@ -524,13 +524,18 @@ QSGNode *DeclarativeChart::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdateP
connect(window(), &QQuickWindow::beforeRendering,
node->glRenderNode(), &DeclarativeRenderNode::render);
}
// Ensure that chart is rendered whenever node is recreated
if (m_sceneImage)
m_sceneImageDirty = true;
}
const QRectF &bRect = boundingRect();
// Update GL data
if (node->glRenderNode() && (m_glXYDataManager->dataMap().size() || m_glXYDataManager->mapDirty())) {
const QRectF &plotArea = m_chart->plotArea();
// Convert plotArea to QRect and back to QRectF to get rid of sub-pixel widths/heights
// which can cause unwanted partial antialising of the graph.
const QRectF plotArea = QRectF(m_chart->plotArea().toRect());
const QSizeF &chartAreaSize = m_chart->size();
// We can't use chart's plot area directly, as graphicscene has some internal minimum size

View File

@ -232,6 +232,7 @@ void DeclarativeRenderNode::renderGL()
QOpenGLBuffer *vbo = m_seriesBufferMap.value(i.key());
GLXYSeriesData *data = i.value();
if (data->visible) {
m_program->setUniformValue(m_colorUniformLoc, data->color);
m_program->setUniformValue(m_minUniformLoc, data->min);
m_program->setUniformValue(m_deltaUniformLoc, data->delta);
@ -258,6 +259,7 @@ void DeclarativeRenderNode::renderGL()
}
vbo->release();
}
}
#ifdef QDEBUG_TRACE_GL_FPS
static QElapsedTimer stopWatch;