summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2023-12-07 12:09:41 +0200
committerJere Tuliniemi <jere.tuliniemi@qt.io>2023-12-07 10:43:44 +0000
commit3fea435d639b73cc4118b6a79acc4e26248fa190 (patch)
tree7a447e98f82241390526d48336492241f342c2cd
parent9e88feff93644b465c4c26d396276fd6a538c57b (diff)
Some more cleanupswip/2D
Change-Id: I9a366a4e011ba1f1970a74100a2771780a502953 Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
-rw-r--r--examples/graphs2d/testbed/main.cpp22
-rw-r--r--examples/graphs2d/testbed/testbed.qrc4
-rw-r--r--src/graphs2d/axis/barcategoryaxis/qbarcategoryaxis.cpp19
-rw-r--r--src/graphs2d/axis/qabstractaxis.cpp11
-rw-r--r--src/graphs2d/axis/qabstractaxis.h5
-rw-r--r--src/graphs2d/axis/qabstractaxis_p.h7
-rw-r--r--src/graphs2d/axis/valueaxis/qvalueaxis.cpp28
-rw-r--r--src/graphs2d/barchart/qabstractbarseries.cpp4
-rw-r--r--src/graphs2d/barchart/qbarseries.cpp4
-rw-r--r--src/graphs2d/barchart/qbarset.cpp4
-rw-r--r--src/graphs2d/data/GridShader.qep2
-rw-r--r--src/graphs2d/data/LineShader.qep2
-rw-r--r--src/graphs2d/data/TickerShader.qep2
-rw-r--r--src/graphs2d/linechart/qlineseries.cpp2
-rw-r--r--src/graphs2d/qabstractseries.cpp8
-rw-r--r--src/graphs2d/scatterchart/qscatterseries.cpp2
-rw-r--r--src/graphs2d/xychart/qxypoint.cpp4
-rw-r--r--src/graphs2d/xychart/qxyseries.cpp2
18 files changed, 32 insertions, 100 deletions
diff --git a/examples/graphs2d/testbed/main.cpp b/examples/graphs2d/testbed/main.cpp
index 1cef264..11d28f3 100644
--- a/examples/graphs2d/testbed/main.cpp
+++ b/examples/graphs2d/testbed/main.cpp
@@ -2,34 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtGui/qguiapplication.h>
-//#include <QtQuick/qquickview.h>
-//#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlapplicationengine.h>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
-/*
- QQuickView viewer;
-
- // The following are needed to make examples run without having to install the module
- // in desktop environments.
-#ifdef Q_OS_WIN
- QString extraImportPath(QStringLiteral("%1/../../../../%2"));
-#else
- QString extraImportPath(QStringLiteral("%1/../../../%2"));
-#endif
- viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(),
- QString::fromLatin1("qml")));
-
- viewer.setTitle(QStringLiteral("Graphs testbed"));
-
- viewer.setSource(QUrl("qrc:/qml/testbed/main.qml"));
- viewer.setResizeMode(QQuickView::SizeRootObjectToView);
- viewer.setColor("black");
- viewer.show();
-*/
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/qml/testbed/main.qml")));
if (engine.rootObjects().isEmpty())
diff --git a/examples/graphs2d/testbed/testbed.qrc b/examples/graphs2d/testbed/testbed.qrc
index 1530969..8c92bfe 100644
--- a/examples/graphs2d/testbed/testbed.qrc
+++ b/examples/graphs2d/testbed/testbed.qrc
@@ -12,5 +12,9 @@
<file>qml/testbed/LineProperties.qml</file>
<file>qml/testbed/images/icon_settings.png</file>
<file>qml/testbed/BarSelection.qml</file>
+ <file>qml/testbed/SettingsView.qml</file>
+ <file>qml/testbed/images/happy_box.png</file>
+ <file>qml/testbed/ScatterProperties.qml</file>
+ <file>qml/testbed/Callout.qml</file>
</qresource>
</RCC>
diff --git a/src/graphs2d/axis/barcategoryaxis/qbarcategoryaxis.cpp b/src/graphs2d/axis/barcategoryaxis/qbarcategoryaxis.cpp
index 56062a9..d8034a0 100644
--- a/src/graphs2d/axis/barcategoryaxis/qbarcategoryaxis.cpp
+++ b/src/graphs2d/axis/barcategoryaxis/qbarcategoryaxis.cpp
@@ -11,34 +11,19 @@
QT_BEGIN_NAMESPACE
/*!
\class QBarCategoryAxis
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QBarCategoryAxis class adds categories to a chart's axes.
QBarCategoryAxis can be set up to show an axis line with tick marks, grid lines, and shades.
Categories are drawn between the ticks. It can be used also with a line series, as demonstrated
by the \l {Charts with Widgets Gallery}.
-
- The following code illustrates how to use QBarCategoryAxis:
- \code
- QChartView *chartView = new QChartView;
- QBarSeries *series = new QBarSeries;
- // ...
- chartView->chart()->addSeries(series);
- chartView->chart()->createDefaultAxes();
-
- QBarCategoryAxis *axisX = new QBarCategoryAxis;
- QStringList categories;
- categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun";
- axisX->append(categories);
- axisX->setRange("Feb", "May");
- chartView->chart()->setAxisX(axisX, series);
\endcode
*/
/*!
\qmltype BarCategoryAxis
\instantiates QBarCategoryAxis
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\inherits AbstractAxis
diff --git a/src/graphs2d/axis/qabstractaxis.cpp b/src/graphs2d/axis/qabstractaxis.cpp
index ef6fc5e..3569c83 100644
--- a/src/graphs2d/axis/qabstractaxis.cpp
+++ b/src/graphs2d/axis/qabstractaxis.cpp
@@ -8,7 +8,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAbstractAxis
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QAbstractAxis class is a base class used for specialized axis classes.
Each series can be bound to one or more horizontal and vertical axes, but mixing axis types
@@ -21,7 +21,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype AbstractAxis
\instantiates QAbstractAxis
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\brief A base type used for specialized axis types.
@@ -307,13 +307,11 @@ QT_BEGIN_NAMESPACE
/*!
\fn void QAbstractAxis::labelsEditableChanged(bool editable)
- \since 5.13
This signal is emitted when the \a editable state of the label changes.
*/
/*!
\fn void QAbstractAxis::labelsTruncatedChanged(bool labelsTruncated)
- \since 6.2
This signal is emitted in two cases; when the axis changes from having one or more truncated
labels to having no truncated labels, and when the axis changes from having no truncated
labels to having one or more truncated labels. Current state is identified by \a labelsTruncated.
@@ -321,7 +319,6 @@ QT_BEGIN_NAMESPACE
/*!
\fn void QAbstractAxis::truncateLabelsChanged(bool truncateLabels)
- \since 6.2
This signal is emitted when the truncation of the labels changes to \a truncateLabels.
*/
@@ -380,7 +377,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
Constructs a new axis object that is a child of \a parent. The ownership is taken by
- QChart when the axis is added.
+ graph when the axis is added.
*/
QAbstractAxis::QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent)
@@ -688,7 +685,6 @@ bool QAbstractAxis::isReverse() const
for the QValueAxis and the QDateTimeAxis.
By default, labels are not editable.
- \since 5.13
*/
void QAbstractAxis::setLabelsEditable(bool editable)
{
@@ -706,7 +702,6 @@ void QAbstractAxis::setLabelsEditable(bool editable)
/*!
Returns \c true if axis labels are editable.
- \since 5.13
*/
bool QAbstractAxis::labelsEditable() const
{
diff --git a/src/graphs2d/axis/qabstractaxis.h b/src/graphs2d/axis/qabstractaxis.h
index 9c05c12..b0b5656 100644
--- a/src/graphs2d/axis/qabstractaxis.h
+++ b/src/graphs2d/axis/qabstractaxis.h
@@ -26,8 +26,8 @@ class QAbstractAxis : public QObject
Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
- Q_PROPERTY(bool labelsTruncated READ labelsTruncated NOTIFY labelsTruncatedChanged REVISION(6, 2))
- Q_PROPERTY(bool truncateLabels READ truncateLabels WRITE setTruncateLabels NOTIFY truncateLabelsChanged REVISION(6, 2))
+ Q_PROPERTY(bool labelsTruncated READ labelsTruncated NOTIFY labelsTruncatedChanged)
+ Q_PROPERTY(bool truncateLabels READ truncateLabels WRITE setTruncateLabels NOTIFY truncateLabelsChanged)
//grid
Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
Q_PROPERTY(bool minorGridVisible READ isMinorGridLineVisible WRITE setMinorGridLineVisible NOTIFY minorGridVisibleChanged)
@@ -44,6 +44,7 @@ class QAbstractAxis : public QObject
Q_PROPERTY(Qt::Alignment alignment READ alignment)
Q_PROPERTY(bool reverse READ isReverse WRITE setReverse NOTIFY reverseChanged)
QML_FOREIGN(QAbstractAxis)
+ QML_NAMED_ELEMENT(AbstractAxis)
public:
diff --git a/src/graphs2d/axis/qabstractaxis_p.h b/src/graphs2d/axis/qabstractaxis_p.h
index 60e0904..a781203 100644
--- a/src/graphs2d/axis/qabstractaxis_p.h
+++ b/src/graphs2d/axis/qabstractaxis_p.h
@@ -26,12 +26,8 @@ QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
-class ChartPresenter;
class AbstractDomain;
-class QChart;
class QAbstractSeries;
-class ChartTheme;
-class ChartElement;
class QAbstractAxisPrivate : public QObject
{
@@ -102,9 +98,6 @@ private:
Q_DECLARE_PUBLIC(QAbstractAxis)
friend class QAbstractAxis;
- friend class QColorAxisPrivate;
- friend class ChartDataSet;
- friend class ChartPresenter;
};
QT_END_NAMESPACE
diff --git a/src/graphs2d/axis/valueaxis/qvalueaxis.cpp b/src/graphs2d/axis/valueaxis/qvalueaxis.cpp
index 808bb81..29f1f07 100644
--- a/src/graphs2d/axis/valueaxis/qvalueaxis.cpp
+++ b/src/graphs2d/axis/valueaxis/qvalueaxis.cpp
@@ -10,30 +10,16 @@
QT_BEGIN_NAMESPACE
/*!
\class QValueAxis
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QValueAxis class adds values to a chart's axes.
A value axis can be set up to show an axis line with tick marks, grid lines, and shades.
The values on the axis are drawn at the positions of tick marks.
-
- The following example code illustrates how to use the QValueAxis class:
- \code
- QChartView *chartView = new QChartView;
- QLineSeries *series = new QLineSeries;
- // ...
- chartView->chart()->addSeries(series);
-
- QValueAxis *axisX = new QValueAxis;
- axisX->setRange(10, 20.5);
- axisX->setTickCount(10);
- axisX->setLabelFormat("%.2f");
- chartView->chart()->setAxisX(axisX, series);
- \endcode
*/
/*!
\qmltype ValueAxis
\instantiates QValueAxis
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\inherits AbstractAxis
\brief Adds values to a chart's axes.
@@ -108,23 +94,19 @@ QT_BEGIN_NAMESPACE
/*!
\property QValueAxis::tickAnchor
- \since 5.12
\brief The base value where the dynamically placed tick marks and labels are started from.
*/
/*!
\qmlproperty real ValueAxis::tickAnchor
- \since QtCharts 2.3
The base value where the dynamically placed tick marks and labels are started from.
*/
/*!
\property QValueAxis::tickInterval
- \since 5.12
\brief The interval between dynamically placed tick marks and labels.
*/
/*!
\qmlproperty real ValueAxis::tickInterval
- \since QtCharts 2.3
The interval between dynamically placed tick marks and labels.
*/
@@ -139,12 +121,10 @@ QT_BEGIN_NAMESPACE
*/
/*!
\property QValueAxis::tickType
- \since 5.12
\brief The positioning method of tick and labels.
*/
/*!
\qmlproperty enumeration ValueAxis::tickType
- \since QtCharts 2.3
The positioning method of tick and labels.
@@ -161,10 +141,6 @@ QT_BEGIN_NAMESPACE
The format string supports the following conversion specifiers, length modifiers, and flags
provided by \c printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
- If QChart::localizeNumbers is \c true, the supported specifiers are limited to:
- d, e, E, f, g, G, and i. Also, only the precision modifier is supported. The rest of the
- formatting comes from the default QLocale of the application.
-
\sa QString::asprintf()
*/
/*!
diff --git a/src/graphs2d/barchart/qabstractbarseries.cpp b/src/graphs2d/barchart/qabstractbarseries.cpp
index 689188d..53fca1d 100644
--- a/src/graphs2d/barchart/qabstractbarseries.cpp
+++ b/src/graphs2d/barchart/qabstractbarseries.cpp
@@ -13,7 +13,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAbstractBarSeries
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QAbstractBarSeries class is an abstract parent class for all bar series classes.
In bar charts, bars are defined as bar sets that contain one data value for each category.
@@ -34,7 +34,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype AbstractBarSeries
\instantiates QAbstractBarSeries
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\inherits AbstractSeries
diff --git a/src/graphs2d/barchart/qbarseries.cpp b/src/graphs2d/barchart/qbarseries.cpp
index 756195c..48b3c36 100644
--- a/src/graphs2d/barchart/qbarseries.cpp
+++ b/src/graphs2d/barchart/qbarseries.cpp
@@ -10,7 +10,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QBarSeries
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QBarSeries class presents a series of data as vertical bars grouped by category.
This class draws data as a series of vertical bars grouped by category, with one bar per
@@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype BarSeries
\instantiates QBarSeries
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\inherits AbstractBarSeries
diff --git a/src/graphs2d/barchart/qbarset.cpp b/src/graphs2d/barchart/qbarset.cpp
index ad531fb..4069b57 100644
--- a/src/graphs2d/barchart/qbarset.cpp
+++ b/src/graphs2d/barchart/qbarset.cpp
@@ -9,7 +9,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QBarSet
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QBarSet class represents one set of bars in a bar chart.
A bar set contains one data value for each category. The first value of a set is assumed to
@@ -24,7 +24,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype BarSet
\instantiates QBarSet
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\brief Represents one set of bars in a bar chart.
diff --git a/src/graphs2d/data/GridShader.qep b/src/graphs2d/data/GridShader.qep
index dd578f4..b4b3628 100644
--- a/src/graphs2d/data/GridShader.qep
+++ b/src/graphs2d/data/GridShader.qep
@@ -11,7 +11,7 @@
"toId": 1
}
],
- "exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
+ "exportDirectory": ".",
"exportFlags": 2,
"exportName": "gridshader",
"nodes": [
diff --git a/src/graphs2d/data/LineShader.qep b/src/graphs2d/data/LineShader.qep
index 800fc16..456bff4 100644
--- a/src/graphs2d/data/LineShader.qep
+++ b/src/graphs2d/data/LineShader.qep
@@ -11,7 +11,7 @@
"toId": 1
}
],
- "exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
+ "exportDirectory": ".",
"exportFlags": 2,
"exportName": "lineshaderhorizontal",
"nodes": [
diff --git a/src/graphs2d/data/TickerShader.qep b/src/graphs2d/data/TickerShader.qep
index 704bcb0..76fd170 100644
--- a/src/graphs2d/data/TickerShader.qep
+++ b/src/graphs2d/data/TickerShader.qep
@@ -11,7 +11,7 @@
"toId": 1
}
],
- "exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
+ "exportDirectory": ".",
"exportFlags": 2,
"exportName": "tickershaderhorizontal",
"nodes": [
diff --git a/src/graphs2d/linechart/qlineseries.cpp b/src/graphs2d/linechart/qlineseries.cpp
index b321f65..6eecc95 100644
--- a/src/graphs2d/linechart/qlineseries.cpp
+++ b/src/graphs2d/linechart/qlineseries.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qlineseries.h"
diff --git a/src/graphs2d/qabstractseries.cpp b/src/graphs2d/qabstractseries.cpp
index f25dbe7..141a63e 100644
--- a/src/graphs2d/qabstractseries.cpp
+++ b/src/graphs2d/qabstractseries.cpp
@@ -9,7 +9,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAbstractSeries
- \inmodule QtCharts
+ \inmodule QtGraphs
\brief The QAbstractSeries class is a base class for all Qt Chart series.
Usually, the series type specific inherited classes are used instead of the base class.
@@ -21,7 +21,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype AbstractSeries
\instantiates QAbstractSeries
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\brief Base type for all Qt Chart series types.
@@ -383,7 +383,7 @@ void QAbstractSeries::hide()
\note If multiple axes of the same orientation are attached to the same series,
they will have the same minimum and maximum values.
- \sa QChart::addAxis(), QChart::createDefaultAxes()
+ \sa QGraphsView::addAxis()
*/
bool QAbstractSeries::attachAxis(QAbstractAxis* axis)
{
@@ -402,7 +402,7 @@ bool QAbstractSeries::attachAxis(QAbstractAxis* axis)
Returns \c true if the axis was detached successfully, \c false otherwise.
- \sa QChart::removeAxis()
+ \sa QGraphsView::removeAxis()
*/
bool QAbstractSeries::detachAxis(QAbstractAxis* axis)
{
diff --git a/src/graphs2d/scatterchart/qscatterseries.cpp b/src/graphs2d/scatterchart/qscatterseries.cpp
index af6fa3d..bb88632 100644
--- a/src/graphs2d/scatterchart/qscatterseries.cpp
+++ b/src/graphs2d/scatterchart/qscatterseries.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "QScatterSeries.h"
diff --git a/src/graphs2d/xychart/qxypoint.cpp b/src/graphs2d/xychart/qxypoint.cpp
index 1477842..0a47223 100644
--- a/src/graphs2d/xychart/qxypoint.cpp
+++ b/src/graphs2d/xychart/qxypoint.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qxypoint_p.h"
@@ -8,7 +8,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype XYPoint
- \inqmlmodule QtCharts
+ \inqmlmodule QtGraphs
\brief Initializes XY-series coordinate data.
diff --git a/src/graphs2d/xychart/qxyseries.cpp b/src/graphs2d/xychart/qxyseries.cpp
index fa7b585..87c63c2 100644
--- a/src/graphs2d/xychart/qxyseries.cpp
+++ b/src/graphs2d/xychart/qxyseries.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses