summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@digia.com>2013-06-03 15:01:25 +0300
committerMika Salmela <mika.salmela@digia.com>2013-06-03 15:08:00 +0300
commitb76baa838f46089ff6d50a2f003b7903594fd443 (patch)
tree8a4c55272934f9d0b741806bfa3ce829081dd1b8 /examples
parent1ed4427c0b81a534f6318c037115164138073706 (diff)
A new box-and-whiskers series type added to charts.
Change-Id: Iab7a05c44026db9925fa0d68afd2b533b3ea2f91 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/boxplotchart/boxdatareader.cpp67
-rw-r--r--examples/boxplotchart/boxdatareader.h42
-rw-r--r--examples/boxplotchart/boxplotchart.pro13
-rw-r--r--examples/boxplotchart/boxplotdata.qrc5
-rw-r--r--examples/boxplotchart/main.cpp85
-rw-r--r--examples/boxplotchart/stock_data.txt13
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/qmlboxplot/main.cpp42
-rw-r--r--examples/qmlboxplot/qml/qmlboxplot/main.qml40
-rw-r--r--examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp177
-rw-r--r--examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.h46
-rw-r--r--examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.pri13
-rw-r--r--examples/qmlboxplot/qmlboxplot.pro11
-rw-r--r--examples/qmlboxplot/resources.qrc5
14 files changed, 561 insertions, 0 deletions
diff --git a/examples/boxplotchart/boxdatareader.cpp b/examples/boxplotchart/boxdatareader.cpp
new file mode 100644
index 00000000..4bc2d404
--- /dev/null
+++ b/examples/boxplotchart/boxdatareader.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "boxdatareader.h"
+
+BoxDataReader::BoxDataReader(QIODevice *device) :
+ QTextStream(device)
+{
+}
+
+QBoxSet* BoxDataReader::readBox()
+{
+ QString line = readLine();
+ if (line.startsWith("#"))
+ return 0;
+
+ QStringList strList = line.split(" ", QString::SkipEmptyParts);
+ sortedList.clear();
+
+ for (int i = 1; i < strList.count(); i++)
+ sortedList.append(strList.at(i).toDouble());
+
+ qSort(sortedList.begin(), sortedList.end());
+
+ int count = sortedList.count();
+
+ QBoxSet *box = new QBoxSet(strList.first());
+ box->setValue(QBoxSet::LowerExtreme, sortedList.first());
+ box->setValue(QBoxSet::UpperExtreme, sortedList.last());
+ box->setValue(QBoxSet::Median, findMedian(0, count));
+ box->setValue(QBoxSet::LowerQuartile, findMedian(0, count / 2));
+ if (count % 2)
+ box->setValue(QBoxSet::UpperQuartile, findMedian(count / 2 + 1, count));
+ else // even amount of numbers
+ box->setValue(QBoxSet::UpperQuartile, findMedian(count / 2, count));
+
+ return box;
+}
+
+qreal BoxDataReader::findMedian(int begin, int end)
+{
+ int count = end - begin;
+ if (count % 2 ) {
+ return sortedList.at(int(count/2) + begin);
+ } else {
+ qreal right = sortedList.at(count / 2 + begin);
+ qreal left = sortedList.at(count / 2 - 1 + begin);
+ return (right + left) / 2.0;
+ }
+}
diff --git a/examples/boxplotchart/boxdatareader.h b/examples/boxplotchart/boxdatareader.h
new file mode 100644
index 00000000..bdaae1bd
--- /dev/null
+++ b/examples/boxplotchart/boxdatareader.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** 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 BOXDATAREADER_H
+#define BOXDATAREADER_H
+
+#include <QTextStream>
+#include <QBoxSet>
+
+QTCOMMERCIALCHART_USE_NAMESPACE
+
+class BoxDataReader : public QTextStream
+{
+public:
+ explicit BoxDataReader(QIODevice *device);
+ QBoxSet* readBox();
+
+protected:
+ qreal findMedian(int begin, int end);
+
+private:
+ QList<qreal> sortedList;
+};
+
+#endif // BOXDATAREADER_H
diff --git a/examples/boxplotchart/boxplotchart.pro b/examples/boxplotchart/boxplotchart.pro
new file mode 100644
index 00000000..c2483511
--- /dev/null
+++ b/examples/boxplotchart/boxplotchart.pro
@@ -0,0 +1,13 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+TARGET = boxplotchart
+SOURCES += main.cpp \
+ boxdatareader.cpp
+
+RESOURCES += \
+ boxplotdata.qrc
+
+HEADERS += \
+ boxdatareader.h
diff --git a/examples/boxplotchart/boxplotdata.qrc b/examples/boxplotchart/boxplotdata.qrc
new file mode 100644
index 00000000..4cea4ba1
--- /dev/null
+++ b/examples/boxplotchart/boxplotdata.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="stock">stock_data.txt</file>
+ </qresource>
+</RCC>
diff --git a/examples/boxplotchart/main.cpp b/examples/boxplotchart/main.cpp
new file mode 100644
index 00000000..7ebb6093
--- /dev/null
+++ b/examples/boxplotchart/main.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** 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 <QApplication>
+#include <QMainWindow>
+#include <QChartView>
+#include <QBoxPlotSeries>
+#include <QBoxSet>
+#include <QLegend>
+#include <QBarCategoryAxis>
+
+#include "boxdatareader.h"
+
+QTCOMMERCIALCHART_USE_NAMESPACE
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+//![1]
+
+//![2]
+ QBoxPlotSeries *series = new QBoxPlotSeries();
+ series->setName("Acme Ltd");
+//![2]
+
+ QFile stockData(":stock");
+ if (!stockData.open(QIODevice::ReadOnly | QIODevice::Text))
+ return 1;
+
+ BoxDataReader dataReader(&stockData);
+ while (!dataReader.atEnd()) {
+ QBoxSet *set = dataReader.readBox();
+ if (set)
+ series->append(set);
+ }
+
+//![3]
+ QChart *chart = new QChart();
+ chart->addSeries(series);
+ chart->setTitle("Acme's share deviation in 2012");
+ chart->setAnimationOptions(QChart::SeriesAnimations);
+//![3]
+
+//![4]
+ chart->createDefaultAxes();
+ chart->axisY()->setMin(15.0);
+//![4]
+
+//![5]
+ chart->legend()->setVisible(true);
+ chart->legend()->setAlignment(Qt::AlignBottom);
+//![5]
+
+//![6]
+ QChartView *chartView = new QChartView(chart);
+ chartView->setRenderHint(QPainter::Antialiasing);
+//![6]
+
+//![7]
+ QMainWindow window;
+ window.setCentralWidget(chartView);
+ window.resize(600, 400);
+ window.show();
+//![7]
+
+ return a.exec();
+}
+
diff --git a/examples/boxplotchart/stock_data.txt b/examples/boxplotchart/stock_data.txt
new file mode 100644
index 00000000..9511418d
--- /dev/null
+++ b/examples/boxplotchart/stock_data.txt
@@ -0,0 +1,13 @@
+# Acme Ltd share deviation in 2012
+Jan 27.74 27.28 27.86 28.05 28.64 27.47 28.30 28.22 28.72 26.50 26.62 26.50 26.15 26.47 26.41 25.78 24.82 24.89 24.88 24.60 23.85
+Feb 31.79 30.62 30.67 31.37 31.16 31.22 32.02 32.70 31.60 31.24 30.98 30.79 31.10 30.79 31.53 30.92 30.00 30.58 30.37 29.40 28.60
+Mar 28.64 28.34 29.13 29.43 30.75 29.77 29.72 30.52 31.12 33.05 32.51 32.69 31.83 32.47 31.41 31.39 31.78 30.08 29.46 31.58 31.39 31.41
+Apr 25.96 26.62 26.19 30.37 28.78 27.50 28.90 28.40 28.86 28.90 27.91 27.32 27.99 26.86 26.68 27.57 27.50 28.96 28.50
+May 20.85 21.08 21.98 21.61 21.45 21.73 21.71 22.27 21.14 20.65 21.95 22.23 23.17 24.26 24.17 22.97 23.53 24.49 24.51 25.46 25.65
+Jun 18.08 17.19 17.36 17.21 17.31 18.19 18.30 17.53 17.35 17.80 17.17 16.95 18.25 20.52 20.61 21.40 20.45 19.43 19.11 19.74
+Jul 17.75 18.24 17.57 16.53 15.98 16.06 16.64 17.69 17.91 18.00 18.03 18.14 18.10 17.86 18.12 18.53 18.43 18.30 19.03 18.76 18.79 18.33
+Aug 18.69 18.54 18.39 18.49 18.96 18.72 19.25 19.70 20.13 19.74 19.27 18.25 17.72 18.02 18.20 18.24 18.60 18.22 18.60 17.98 17.27 16.70 17.19
+Sep 18.35 18.82 18.96 19.96 19.75 20.55 20.68 21.19 21.14 21.48 21.45 20.74 20.97 20.18 19.66 19.54 18.89 18.39 18.26 18.86
+Oct 16.95 16.80 16.45 16.89 17.38 17.12 16.85 17.59 17.65 17.46 17.43 17.30 17.87 18.61 18.55 18.59 19.27 19.54 20.02 19.23 18.05 18.52 18.71
+Now 19.36 19.29 18.22 18.74 19.05 19.13 18.67 18.19 17.94 18.04 17.49 17.53 17.64 18.00 18.21 18.19 18.30 18.11 18.17 17.76 17.80 17.52
+Dec 19.95 20.19 20.15 20.42 20.39 20.65 20.39 19.86 19.48 19.70 19.94 19.82 20.25 20.21 19.63 19.55
diff --git a/examples/examples.pro b/examples/examples.pro
index 716dce54..f6a63bb5 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -19,8 +19,10 @@ SUBDIRS += \
zoomlinechart \
modeldata \
barchart \
+ boxplotchart \
legend \
barmodelmapper \
+ qmlboxplot \
qmlpiechart \
lineandbar \
horizontalbarchart \
diff --git a/examples/qmlboxplot/main.cpp b/examples/qmlboxplot/main.cpp
new file mode 100644
index 00000000..eab3b643
--- /dev/null
+++ b/examples/qmlboxplot/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** 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 <QApplication>
+#include <QtDeclarative/QDeclarativeEngine>
+#include "qmlapplicationviewer.h"
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QScopedPointer<QApplication> app(createApplication(argc, argv));
+ QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
+#ifdef Q_OS_ANDROID
+ viewer->addImportPath(QString::fromLatin1("assets:/imports"));
+ viewer->engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), QString::fromLatin1("lib")));
+#else
+ viewer->addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QString::fromLatin1("imports")));
+#endif
+
+ // // 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 00000000..8bbedf93
--- /dev/null
+++ b/examples/qmlboxplot/qml/qmlboxplot/main.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtCommercial.Chart 1.3
+
+ChartView {
+ title: "Box Plot series"
+ width: 400
+ height: 300
+ theme: ChartView.ChartThemeBrownSand
+ legend.alignment: Qt.AlignBottom
+
+ BoxPlotSeries {
+ id: plotSeries
+ name: "Income"
+ BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] }
+ BoxSet { label: "Feb"; values: [5, 6, 7.5, 8.6, 11.8] }
+ BoxSet { label: "Mar"; values: [3.2, 5, 5.7, 8, 9.2] }
+ BoxSet { label: "Apr"; values: [3.8, 5, 6.4, 7, 8] }
+ BoxSet { label: "May"; values: [4, 5, 5.2, 6, 7] }
+ }
+}
diff --git a/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..cb227056
--- /dev/null
+++ b/examples/qmlboxplot/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,177 @@
+// checksum 0xaa72 version 0x90018
+/*
+ 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 <QDir>
+#include <QFileInfo>
+#include <QApplication>
+#include <QDeclarativeComponent>
+#include <QDeclarativeEngine>
+#include <QDeclarativeContext>
+
+#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
+
+#ifdef HARMATTAN_BOOSTER
+#include <MDeclarativeCache>
+#endif
+
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+
+#include <qt_private/qdeclarativedebughelper_p.h>
+
+#if !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#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_BLACKBERRY)
+ 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<Qt::WidgetAttribute>(128);
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = static_cast<Qt::WidgetAttribute>(129);
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = static_cast<Qt::WidgetAttribute>(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 00000000..fba2d52a
--- /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 <QDeclarativeView>
+
+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 00000000..567c6dc6
--- /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 00000000..194aef38
--- /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/resources.qrc b/examples/qmlboxplot/resources.qrc
new file mode 100644
index 00000000..49a98f16
--- /dev/null
+++ b/examples/qmlboxplot/resources.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/qmlboxplot/main.qml</file>
+ </qresource>
+</RCC>