From 20a93e498d73f2647131e1663e54ecf7b17be4bb 2013-04-16 07:05:47 From: Mika Salmela Date: 2013-04-16 07:05:47 Subject: [PATCH] QML Plugins and sample for that Change-Id: I74bbc82149936be75c960fec0470256c05be3c87 Reviewed-by: Mika Salmela --- diff --git a/examples/examples.pro b/examples/examples.pro index ef1012f..ef0230e 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -22,6 +22,7 @@ SUBDIRS += \ boxplotchart \ legend \ barmodelmapper \ + qmlboxplot \ qmlpiechart \ lineandbar \ horizontalbarchart \ diff --git a/examples/qmlboxplot/main.cpp b/examples/qmlboxplot/main.cpp new file mode 100644 index 0000000..721edeb --- /dev/null +++ b/examples/qmlboxplot/main.cpp @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "qmlapplicationviewer.h" + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QScopedPointer app(createApplication(argc, argv)); + QScopedPointer viewer(QmlApplicationViewer::create()); + + // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer->setSource(QUrl("qrc:/qml/qmlboxplot/main.qml")); + viewer->setRenderHint(QPainter::Antialiasing, true); + viewer->showExpanded(); + + return app->exec(); +} diff --git a/examples/qmlboxplot/qml/qmlboxplot/main.qml b/examples/qmlboxplot/qml/qmlboxplot/main.qml new file mode 100644 index 0000000..554d4e6 --- /dev/null +++ b/examples/qmlboxplot/qml/qmlboxplot/main.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![1] +import QtQuick 1.0 +import QtCommercial.Chart 1.1 + +ChartView { + title: "Box Plot series" + width: 400 + height: 300 + theme: ChartView.ChartThemeBrownSand + legend.alignment: Qt.AlignBottom + +//![1] +//![2] + BoxPlotSeries { + id: plotSeries + name: "Income" + axisX: BarCategoryAxis { categories: ["Jan", "Feb", "Mar", "Apr", "May"] } + BarSet { label: "Jan"; values: [3, 4, 4.4, 6, 7] } + BarSet { label: "Feb"; values: [5, 6, 7.5, 8, 12] } + BarSet { label: "Mar"; values: [2, 5, 5.7, 8, 9] } + BarSet { label: "Apr"; values: [5, 6, 6.8, 7, 8] } + BarSet { label: "May"; values: [4, 5, 5.2, 6, 7] } + } +//![2] + + +//![3] +} +//![3] diff --git a/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..0f12265 --- /dev/null +++ b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,177 @@ +// checksum 0xbd34 version 0x80016 +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#include "qmlapplicationviewer.h" + +#include +#include +#include +#include +#include +#include + +#include // MEEGO_EDITION_HARMATTAN + +#ifdef HARMATTAN_BOOSTER +#include +#endif + +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 + +#include + +#if !defined(NO_JSDEBUGGER) +#include +#endif +#if !defined(NO_QMLOBSERVER) +#include +#endif + +// Enable debugging before any QDeclarativeEngine is created +struct QmlJsDebuggingEnabler +{ + QmlJsDebuggingEnabler() + { + QDeclarativeDebugHelper::enableDebugging(); + } +}; + +// Execute code in constructor before first QDeclarativeEngine is instantiated +static QmlJsDebuggingEnabler enableDebuggingHelper; + +#endif // QMLJSDEBUGGER + +class QmlApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QmlApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QmlApplicationViewerPrivate::adjustPath(const QString &path) +{ +#ifdef Q_OS_MAC + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/../Resources/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_QNX) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); +#elif !defined(Q_OS_ANDROID) + QString pathInInstallDir = + QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; + pathInInstallDir = + QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#endif + return path; +} + +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) + : QDeclarativeView(parent) + , d(new QmlApplicationViewerPrivate()) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QDeclarativeView::SizeRootObjectToView); + + // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 +#if !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if !defined(NO_QMLOBSERVER) + new QmlJSDebugger::QDeclarativeViewObserver(this, this); +#endif +#endif +} + +QmlApplicationViewer::~QmlApplicationViewer() +{ + delete d; +} + +QmlApplicationViewer *QmlApplicationViewer::create() +{ + return new QmlApplicationViewer(); +} + +void QmlApplicationViewer::setMainQmlFile(const QString &file) +{ + d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); +#ifdef Q_OS_ANDROID + setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); +#else + setSource(QUrl::fromLocalFile(d->mainQmlFile)); +#endif +} + +void QmlApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); +} + +void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) +{ +#if QT_VERSION < 0x050000 + Qt::WidgetAttribute attribute; + switch (orientation) { +#if QT_VERSION < 0x040702 + // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes + case ScreenOrientationLockPortrait: + attribute = static_cast(128); + break; + case ScreenOrientationLockLandscape: + attribute = static_cast(129); + break; + default: + case ScreenOrientationAuto: + attribute = static_cast(130); + break; +#else // QT_VERSION < 0x040702 + case ScreenOrientationLockPortrait: + attribute = Qt::WA_LockPortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_LockLandscapeOrientation; + break; + default: + case ScreenOrientationAuto: + attribute = Qt::WA_AutoOrientation; + break; +#endif // QT_VERSION < 0x040702 + }; + setAttribute(attribute, true); +#else // QT_VERSION < 0x050000 + Q_UNUSED(orientation) +#endif // QT_VERSION < 0x050000 +} + +void QmlApplicationViewer::showExpanded() +{ +#if defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_OS_QNX) + showMaximized(); +#else + show(); +#endif +} + +QApplication *createApplication(int &argc, char **argv) +{ +#ifdef HARMATTAN_BOOSTER + return MDeclarativeCache::qApplication(argc, argv); +#else + return new QApplication(argc, argv); +#endif +} diff --git a/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.h b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..fba2d52 --- /dev/null +++ b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,46 @@ +// checksum 0xc67a version 0x80016 +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#ifndef QMLAPPLICATIONVIEWER_H +#define QMLAPPLICATIONVIEWER_H + +#include + +class QmlApplicationViewer : public QDeclarativeView +{ + Q_OBJECT + +public: + enum ScreenOrientation { + ScreenOrientationLockPortrait, + ScreenOrientationLockLandscape, + ScreenOrientationAuto + }; + + explicit QmlApplicationViewer(QWidget *parent = 0); + virtual ~QmlApplicationViewer(); + + static QmlApplicationViewer *create(); + + void setMainQmlFile(const QString &file); + void addImportPath(const QString &path); + + // Note that this will only have an effect on Fremantle. + void setOrientation(ScreenOrientation orientation); + + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *d; +}; + +QApplication *createApplication(int &argc, char **argv); + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..567c6dc --- /dev/null +++ b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,13 @@ +QT += declarative + +SOURCES += $$PWD/qmlapplicationviewer.cpp +HEADERS += $$PWD/qmlapplicationviewer.h +INCLUDEPATH += $$PWD + +# Include JS debugger library if QMLJSDEBUGGER_PATH is set +!isEmpty(QMLJSDEBUGGER_PATH) { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) +} else { + DEFINES -= QMLJSDEBUGGER +} + diff --git a/examples/qmlboxplot/qmlboxplot.pro b/examples/qmlboxplot/qmlboxplot.pro new file mode 100644 index 0000000..194aef3 --- /dev/null +++ b/examples/qmlboxplot/qmlboxplot.pro @@ -0,0 +1,11 @@ +!include( ../examples.pri ) { + error( "Couldn't find the examples.pri file!" ) +} + +RESOURCES += resources.qrc +SOURCES += main.cpp + +include(qmlapplicationviewer/qmlapplicationviewer.pri) + +OTHER_FILES += \ + qml/qmlboxplot/main.qml diff --git a/examples/qmlboxplot/qmlboxplot.svg b/examples/qmlboxplot/qmlboxplot.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/examples/qmlboxplot/qmlboxplot.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/qmlboxplot/resources.qrc b/examples/qmlboxplot/resources.qrc new file mode 100644 index 0000000..49a98f1 --- /dev/null +++ b/examples/qmlboxplot/resources.qrc @@ -0,0 +1,5 @@ + + + qml/qmlboxplot/main.qml + + diff --git a/plugins/declarative/declarative.pro b/plugins/declarative/declarative.pro index 7641b2b..9f38d75 100644 --- a/plugins/declarative/declarative.pro +++ b/plugins/declarative/declarative.pro @@ -25,7 +25,8 @@ SOURCES += \ declarativebarseries.cpp \ declarativecategoryaxis.cpp \ declarativemargins.cpp \ - declarativeaxes.cpp + declarativeaxes.cpp \ + declarativeboxplotseries.cpp HEADERS += \ declarativechart.h \ @@ -39,7 +40,8 @@ HEADERS += \ declarativebarseries.h \ declarativecategoryaxis.h \ declarativemargins.h \ - declarativeaxes.h + declarativeaxes.h \ + declarativeboxplotseries.h TARGETPATH = QtCommercial/Chart target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH diff --git a/plugins/declarative/declarativeboxplotseries.cpp b/plugins/declarative/declarativeboxplotseries.cpp new file mode 100644 index 0000000..544a337 --- /dev/null +++ b/plugins/declarative/declarativeboxplotseries.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "declarativebarseries.h" +#include "declarativeboxplotseries.h" +#include "qbarset.h" +#include "qvbarmodelmapper.h" +#include "qhbarmodelmapper.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDeclarativeItem *parent) : + QBoxPlotSeries(parent), + m_axes(new DeclarativeAxes(this)) +{ + connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); + connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); + connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); + connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); +} + +void DeclarativeBoxPlotSeries::classBegin() +{ +} + +void DeclarativeBoxPlotSeries::componentComplete() +{ + foreach (QObject *child, children()) { + if (qobject_cast(child)) { + QAbstractBarSeries::append(qobject_cast(child)); + } else if (qobject_cast(child)) { + QVBarModelMapper *mapper = qobject_cast(child); + mapper->setSeries(this); + } else if (qobject_cast(child)) { + QHBarModelMapper *mapper = qobject_cast(child); + mapper->setSeries(this); + } + } +} + +QDeclarativeListProperty DeclarativeBoxPlotSeries::seriesChildren() +{ + return QDeclarativeListProperty(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren); +} + +void DeclarativeBoxPlotSeries::appendSeriesChildren(QDeclarativeListProperty * list, QObject *element) +{ + // Empty implementation; the children are parsed in componentComplete instead + Q_UNUSED(list); + Q_UNUSED(element); +} + +DeclarativeBarSet *DeclarativeBoxPlotSeries::at(int index) +{ + QList setList = barSets(); + if (index >= 0 && index < setList.count()) + return qobject_cast(setList[index]); + + return 0; +} + +DeclarativeBarSet *DeclarativeBoxPlotSeries::insert(int index, QString label, QVariantList values) +{ + DeclarativeBarSet *barset = new DeclarativeBarSet(this); + barset->setLabel(label); + barset->setValues(values); + if (QBoxPlotSeries::insert(index, barset)) + return barset; + delete barset; + return 0; +} + + +#include "moc_declarativeboxplotseries.cpp" + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/plugins/declarative/declarativeboxplotseries.h b/plugins/declarative/declarativeboxplotseries.h new file mode 100644 index 0000000..cd0c010 --- /dev/null +++ b/plugins/declarative/declarativeboxplotseries.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DECLARATIVEBOXPLOT_H +#define DECLARATIVEBOXPLOT_H + +#include "qbarset.h" +#include "declarativeaxes.h" +#include "qboxplotseries.h" +#include +#include + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDeclarativeParserStatus +{ + Q_OBJECT + Q_INTERFACES(QDeclarativeParserStatus) + Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) + Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) + Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) + Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) + Q_PROPERTY(QDeclarativeListProperty seriesChildren READ seriesChildren) + Q_CLASSINFO("DefaultProperty", "seriesChildren") + +public: + explicit DeclarativeBoxPlotSeries(QDeclarativeItem *parent = 0); + QAbstractAxis *axisX() { return m_axes->axisX(); } + void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } + QAbstractAxis *axisY() { return m_axes->axisY(); } + void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } + Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } + Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } + Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } + Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } + QDeclarativeListProperty seriesChildren(); + +public: + Q_INVOKABLE DeclarativeBarSet *at(int index); + Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } + Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); + Q_INVOKABLE bool remove(QBarSet *barset) { return QBoxPlotSeries::remove(barset); } + Q_INVOKABLE void clear() { return QBoxPlotSeries::clear(); } + +public: // from QDeclarativeParserStatus + void classBegin(); + void componentComplete(); + +Q_SIGNALS: + Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); + Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); + Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); + Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); + +public Q_SLOTS: + static void appendSeriesChildren(QDeclarativeListProperty *list, QObject *element); + +public: + DeclarativeAxes *m_axes; +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif // DECLARATIVEBOXPLOT_H diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp index 7e5500b..f7c0dea 100644 --- a/plugins/declarative/declarativechart.cpp +++ b/plugins/declarative/declarativechart.cpp @@ -26,6 +26,7 @@ #include "declarativebarseries.h" #include "declarativepieseries.h" #include "declarativesplineseries.h" +#include "declarativeboxplotseries.h" #include "declarativescatterseries.h" #include "qbarcategoryaxis.h" #include "qvalueaxis.h" @@ -622,6 +623,9 @@ QAbstractSeries *DeclarativeChart::createSeries(int type, QString name, QAbstrac case DeclarativeChart::SeriesTypeHorizontalStackedBar: series = new DeclarativeHorizontalStackedBarSeries(); break; + case DeclarativeChart::SeriesTypeBoxPlot: + series = new DeclarativeBoxPlotSeries(); + break; case DeclarativeChart::SeriesTypePie: series = new DeclarativePieSeries(); break; @@ -735,6 +739,8 @@ void DeclarativeChart::initializeAxes(QAbstractSeries *series) doInitializeAxes(series, qobject_cast(series)->m_axes); else if (qobject_cast(series)) doInitializeAxes(series, qobject_cast(series)->m_axes); + else if (qobject_cast(series)) + doInitializeAxes(series, qobject_cast(series)->m_axes); // else: do nothing } diff --git a/plugins/declarative/declarativechart.h b/plugins/declarative/declarativechart.h index 6911606..c49ac83 100644 --- a/plugins/declarative/declarativechart.h +++ b/plugins/declarative/declarativechart.h @@ -81,6 +81,7 @@ public: SeriesTypeBar, SeriesTypeStackedBar, SeriesTypePercentBar, + SeriesTypeBoxPlot, SeriesTypePie, SeriesTypeScatter, SeriesTypeSpline, diff --git a/plugins/declarative/plugin.cpp b/plugins/declarative/plugin.cpp index 2b4fd0a..dbde203 100644 --- a/plugins/declarative/plugin.cpp +++ b/plugins/declarative/plugin.cpp @@ -30,6 +30,7 @@ #include "declarativeareaseries.h" #include "declarativescatterseries.h" #include "declarativebarseries.h" +#include "declarativeboxplotseries.h" #include "declarativepieseries.h" #include "declarativeaxes.h" #include "qvxymodelmapper.h" @@ -65,6 +66,7 @@ Q_DECLARE_METATYPE(DeclarativeChart *) Q_DECLARE_METATYPE(DeclarativeMargins *) Q_DECLARE_METATYPE(DeclarativeAreaSeries *) Q_DECLARE_METATYPE(DeclarativeBarSeries *) +Q_DECLARE_METATYPE(DeclarativeBoxPlotSeries *) Q_DECLARE_METATYPE(DeclarativeLineSeries *) Q_DECLARE_METATYPE(DeclarativePieSeries *) Q_DECLARE_METATYPE(DeclarativeScatterSeries *) @@ -141,6 +143,7 @@ public: qmlRegisterType(uri, 1, 0, "BarSeries"); qmlRegisterType(uri, 1, 0, "StackedBarSeries"); qmlRegisterType(uri, 1, 0, "PercentBarSeries"); + qmlRegisterType(uri, 1, 0, "BoxPlotSeries"); qmlRegisterType(uri, 1, 0, "PieSeries"); qmlRegisterType(uri, 1, 0, "PieSlice"); qmlRegisterType(uri, 1, 0, "BarSet"); @@ -186,6 +189,7 @@ public: qmlRegisterType(uri, 1, 1, "BarSeries"); qmlRegisterType(uri, 1, 1, "StackedBarSeries"); qmlRegisterType(uri, 1, 1, "PercentBarSeries"); + qmlRegisterType(uri, 1, 1, "BoxPlotSeries"); qmlRegisterType(uri, 1, 1, "HorizontalBarSeries"); qmlRegisterType(uri, 1, 1, "HorizontalStackedBarSeries"); qmlRegisterType(uri, 1, 1, "HorizontalPercentBarSeries"); @@ -210,6 +214,7 @@ public: qmlRegisterType(uri, 1, 2, "BarSeries"); qmlRegisterType(uri, 1, 2, "StackedBarSeries"); qmlRegisterType(uri, 1, 2, "PercentBarSeries"); + qmlRegisterType(uri, 1, 2, "BoxPlotSeries"); qmlRegisterType(uri, 1, 2, "HorizontalBarSeries"); qmlRegisterType(uri, 1, 2, "HorizontalStackedBarSeries"); qmlRegisterType(uri, 1, 2, "HorizontalPercentBarSeries");