Some more cleanups

Change-Id: I9a366a4e011ba1f1970a74100a2771780a502953
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
This commit is contained in:
Kaj Grönholm 2023-12-07 12:09:41 +02:00 committed by Jere Tuliniemi
parent 9e88feff93
commit 3fea435d63
18 changed files with 32 additions and 100 deletions

View File

@ -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())

View File

@ -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>

View File

@ -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

View File

@ -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
{

View File

@ -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:

View File

@ -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

View File

@ -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()
*/
/*!

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -11,7 +11,7 @@
"toId": 1
}
],
"exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
"exportDirectory": ".",
"exportFlags": 2,
"exportName": "gridshader",
"nodes": [

View File

@ -11,7 +11,7 @@
"toId": 1
}
],
"exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
"exportDirectory": ".",
"exportFlags": 2,
"exportName": "lineshaderhorizontal",
"nodes": [

View File

@ -11,7 +11,7 @@
"toId": 1
}
],
"exportDirectory": "../../../../../../../qt6/qtgraphs/src/charts/data",
"exportDirectory": ".",
"exportFlags": 2,
"exportName": "tickershaderhorizontal",
"nodes": [

View File

@ -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"

View File

@ -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)
{

View File

@ -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"

View File

@ -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.

View File

@ -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