KQuickCharts

ChartsPlugin.cpp
1/*
2 * This file is part of KQuickCharts
3 * SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7
8#include "ChartsPlugin.h"
9
10#include "BarChart.h"
11#include "Chart.h"
12#include "LineChart.h"
13#include "PieChart.h"
14#include "RangeGroup.h"
15#include "XYChart.h"
16
17#include "decorations/AxisLabels.h"
18#include "decorations/GridLines.h"
19#include "decorations/LegendModel.h"
20#include "decorations/LegendLayout.h"
21
22#include "datasource/ArraySource.h"
23#include "datasource/ChartAxisSource.h"
24#include "datasource/ColorGradientSource.h"
25#include "datasource/HistoryProxySource.h"
26#include "datasource/MapProxySource.h"
27#include "datasource/ModelSource.h"
28#include "datasource/SingleValueSource.h"
29
30#include "quickcharts_export.h"
31
32QuickChartsPlugin::QuickChartsPlugin(QObject *parent)
33 : QQmlExtensionPlugin(parent)
34{
35}
36
37void QuickChartsPlugin::registerTypes(const char *uri)
38{
39 Q_ASSERT(QString::fromLatin1(uri) == QLatin1String("org.kde.quickcharts"));
40
41 qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
42
43 qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
44 qmlRegisterType<LineChart>(uri, 1, 0, "LineChart");
45 qmlRegisterType<BarChart>(uri, 1, 0, "BarChart");
46 qmlRegisterUncreatableType<XYChart>(uri, 1, 0, "XYChart", QStringLiteral("Just a base class"));
47 qmlRegisterUncreatableType<Chart>(uri, 1, 0, "Chart", QStringLiteral("Just a base class"));
48
49 qmlRegisterUncreatableType<ChartDataSource>(uri, 1, 0, "ChartDataSource", QStringLiteral("Just a base class"));
50 qmlRegisterType<ModelSource>(uri, 1, 0, "ModelSource");
51 qmlRegisterType<SingleValueSource>(uri, 1, 0, "SingleValueSource");
52 qmlRegisterType<ArraySource>(uri, 1, 0, "ArraySource");
53 qmlRegisterType<ChartAxisSource>(uri, 1, 0, "ChartAxisSource");
54 qmlRegisterType<ColorGradientSource>(uri, 1, 0, "ColorGradientSource");
55 qmlRegisterType<MapProxySource>(uri, 1, 0, "MapProxySource");
56 qmlRegisterType<HistoryProxySource>(uri, 1, 0, "HistoryProxySource");
57
58 qmlRegisterUncreatableType<RangeGroup>(uri, 1, 0, "Range", QStringLiteral("Used as a grouped property"));
59
60 qmlRegisterType<GridLines>(uri, 1, 0, "GridLines");
61 qmlRegisterUncreatableType<LinePropertiesGroup>(uri, 1, 0, "LinePropertiesGroup", QStringLiteral("Used as a grouped property"));
62 qmlRegisterType<AxisLabels>(uri, 1, 0, "AxisLabels");
63 qmlRegisterUncreatableType<AxisLabelsAttached>(uri, 1, 0, "AxisLabelsAttached", QStringLiteral("Attached property"));
64 qmlRegisterType<LegendModel>(uri, 1, 0, "LegendModel");
65 qmlRegisterType<LegendLayout>(uri, 1, 0, "LegendLayout");
66}
67
68#include "moc_ChartsPlugin.cpp"
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:57 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.