diff options
Diffstat (limited to 'demos')
165 files changed, 0 insertions, 10001 deletions
diff --git a/demos/audio/audio.pro b/demos/audio/audio.pro deleted file mode 100644 index 0bd25015..00000000 --- a/demos/audio/audio.pro +++ /dev/null @@ -1,13 +0,0 @@ -!include( ../demos.pri ):error( "Couldn't find the demos.pri file!" ) - -QT += multimedia - -TARGET = audio -TEMPLATE = app - -SOURCES += main.cpp\ - widget.cpp \ - xyseriesiodevice.cpp - -HEADERS += widget.h \ - xyseriesiodevice.h diff --git a/demos/audio/main.cpp b/demos/audio/main.cpp deleted file mode 100644 index dd9069df..00000000 --- a/demos/audio/main.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "widget.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - Widget w; - w.show(); - - return a.exec(); -} diff --git a/demos/audio/widget.cpp b/demos/audio/widget.cpp deleted file mode 100644 index f31de40b..00000000 --- a/demos/audio/widget.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "widget.h" -#include <QAudioDeviceInfo> -#include <QAudioInput> -#include <QChartView> -#include <QLineSeries> -#include <QChart> -#include <QVBoxLayout> -#include <QValueAxis> -#include "xyseriesiodevice.h" - -QTCOMMERCIALCHART_USE_NAMESPACE - -Widget::Widget(QWidget *parent) - : QWidget(parent), - m_device(0), - m_chart(0), - m_series(0), - m_audioInput(0) -{ - m_chart = new QChart; - QChartView *chartView = new QChartView(m_chart); - chartView->setMinimumSize(800, 600); - m_series = new QLineSeries; - m_chart->addSeries(m_series); - QValueAxis *axisX = new QValueAxis; - axisX->setRange(0, 2000); - axisX->setLabelFormat("%g"); - axisX->setTitleText("Samples"); - QValueAxis *axisY = new QValueAxis; - axisY->setRange(-1, 1); - axisY->setTitleText("Audio level"); - m_chart->setAxisX(axisX, m_series); - m_chart->setAxisY(axisY, m_series); - m_chart->legend()->hide(); - m_chart->setTitle("Data from the microphone"); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(chartView); - setLayout(mainLayout); - - QAudioFormat formatAudio; - formatAudio.setSampleRate(8000); - formatAudio.setChannelCount(1); - formatAudio.setSampleSize(8); - formatAudio.setCodec("audio/pcm"); - formatAudio.setByteOrder(QAudioFormat::LittleEndian); - formatAudio.setSampleType(QAudioFormat::UnSignedInt); - - QAudioDeviceInfo inputDevices = QAudioDeviceInfo::defaultInputDevice(); - m_audioInput = new QAudioInput(inputDevices,formatAudio, this); - - m_device = new XYSeriesIODevice(m_series, this); - m_device->open(QIODevice::WriteOnly); - - m_audioInput->start(m_device); -} - -Widget::~Widget() -{ - m_audioInput->stop(); - m_device->close(); -} diff --git a/demos/audio/widget.h b/demos/audio/widget.h deleted file mode 100644 index fa6a2804..00000000 --- a/demos/audio/widget.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 WIDGET_H -#define WIDGET_H - -#include <QWidget> -#include <QChartGlobal> - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QLineSeries; -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -class XYSeriesIODevice; -class QAudioInput; - -class Widget : public QWidget -{ - Q_OBJECT - -public: - Widget(QWidget *parent = 0); - ~Widget(); - -private: - XYSeriesIODevice *m_device; - QChart *m_chart; - QLineSeries *m_series; - QAudioInput *m_audioInput; -}; - -#endif // WIDGET_H diff --git a/demos/audio/xyseriesiodevice.cpp b/demos/audio/xyseriesiodevice.cpp deleted file mode 100644 index 5440771f..00000000 --- a/demos/audio/xyseriesiodevice.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "xyseriesiodevice.h" -#include <QXYSeries> - -XYSeriesIODevice::XYSeriesIODevice(QXYSeries * series, QObject *parent) : - QIODevice(parent), - m_series(series) -{ -} - -qint64 XYSeriesIODevice::readData(char * data, qint64 maxSize) -{ - Q_UNUSED(data) - Q_UNUSED(maxSize) - return -1; -} - -qint64 XYSeriesIODevice::writeData(const char * data, qint64 maxSize) -{ - qint64 range = 2000; - QList<QPointF> oldPoints = m_series->points(); - QList<QPointF> points; - int resolution = 4; - - if (oldPoints.count() < range) { - points = m_series->points(); - } else { - for (int i = maxSize/resolution; i < oldPoints.count(); i++) - points.append(QPointF(i - maxSize/resolution, oldPoints.at(i).y())); - } - - qint64 size = points.count(); - for (int k = 0; k < maxSize/resolution; k++) - points.append(QPointF(k + size, ((quint8)data[resolution * k] - 128)/128.0)); - - m_series->replace(points); - return maxSize; -} diff --git a/demos/audio/xyseriesiodevice.h b/demos/audio/xyseriesiodevice.h deleted file mode 100644 index f7f9fbdd..00000000 --- a/demos/audio/xyseriesiodevice.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 XYSERIESIODEVICE_H -#define XYSERIESIODEVICE_H - -#include <QIODevice> -#include <QChartGlobal> - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QXYSeries; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -class XYSeriesIODevice : public QIODevice -{ - Q_OBJECT -public: - explicit XYSeriesIODevice(QXYSeries * series, QObject *parent = 0); - -protected: - qint64 readData(char * data, qint64 maxSize); - qint64 writeData(const char * data, qint64 maxSize); - -private: - QXYSeries *m_series; -}; - -#endif // XYSERIESIODEVICE_H diff --git a/demos/callout/callout.cpp b/demos/callout/callout.cpp deleted file mode 100644 index 2491368f..00000000 --- a/demos/callout/callout.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "callout.h" -#include <QPainter> -#include <QFontMetrics> -#include <QGraphicsSceneMouseEvent> -#include <QMouseEvent> - -Callout::Callout(QGraphicsItem * parent): - QGraphicsItem(parent) -{ -} - -QRectF Callout::boundingRect() const -{ - QPointF anchor = mapFromParent(m_anchor); - QRectF rect; - rect.setLeft(qMin(m_rect.left(), anchor.x())); - rect.setRight(qMax(m_rect.right(), anchor.x())); - rect.setTop(qMin(m_rect.top(), anchor.y())); - rect.setBottom(qMax(m_rect.bottom(), anchor.y())); - return rect; -} - -void Callout::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - Q_UNUSED(option) - Q_UNUSED(widget) - QPainterPath path; - path.addRoundedRect(m_rect, 5, 5); - - QPointF anchor = mapFromParent(m_anchor); - if (!m_rect.contains(anchor)) { - QPointF point1, point2; - - // establish the position of the anchor point in relation to m_rect - bool above = anchor.y() <= m_rect.top(); - bool aboveCenter = anchor.y() > m_rect.top() && anchor.y() <= m_rect.center().y(); - bool belowCenter = anchor.y() > m_rect.center().y() && anchor.y() <= m_rect.bottom(); - bool below = anchor.y() > m_rect.bottom(); - - bool onLeft = anchor.x() <= m_rect.left(); - bool leftOfCenter = anchor.x() > m_rect.left() && anchor.x() <= m_rect.center().x(); - bool rightOfCenter = anchor.x() > m_rect.center().x() && anchor.x() <= m_rect.right(); - bool onRight = anchor.x() > m_rect.right(); - - // get the nearest m_rect corner. - qreal x = (onRight + rightOfCenter) * m_rect.width(); - qreal y = (below + belowCenter) * m_rect.height(); - bool cornerCase = (above && onLeft) || (above && onRight) || (below && onLeft) || (below && onRight); - bool vertical = qAbs(anchor.x() - x) > qAbs(anchor.y() - y); - - qreal x1 = x + leftOfCenter * 10 - rightOfCenter * 20 + cornerCase * !vertical * (onLeft * 10 - onRight * 20); - qreal y1 = y + aboveCenter * 10 - belowCenter * 20 + cornerCase * vertical * (above * 10 - below * 20);; - point1.setX(x1); - point1.setY(y1); - - qreal x2 = x + leftOfCenter * 20 - rightOfCenter * 10 + cornerCase * !vertical * (onLeft * 20 - onRight * 10);; - qreal y2 = y + aboveCenter * 20 - belowCenter * 10 + cornerCase * vertical * (above * 20 - below * 10);; - point2.setX(x2); - point2.setY(y2); - - path.moveTo(point1); - path.lineTo(mapFromParent(m_anchor)); - path.lineTo(point2); - path = path.simplified(); - } - painter->setBrush(QColor(255, 255, 255)); - painter->drawPath(path); - painter->drawText(m_textRect, m_text); -} - -void Callout::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - event->setAccepted(true); -} - -void Callout::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - if (event->buttons() & Qt::LeftButton){ - setPos(mapToParent(event->pos() - event->buttonDownPos(Qt::LeftButton))); - event->setAccepted(true); - } else { - event->setAccepted(false); - } -} - -void Callout::setText(const QString &text) -{ - m_text = text; - QFontMetrics metrics(m_font); - m_textRect = metrics.boundingRect(QRect(0, 0, 150, 150), Qt::AlignLeft, m_text); - m_textRect.translate(5, 5); - prepareGeometryChange(); - m_rect = m_textRect.adjusted(-5, -5, 5, 5); -} - -void Callout::setAnchor(QPointF point) -{ - m_anchor = point; -} diff --git a/demos/callout/callout.h b/demos/callout/callout.h deleted file mode 100644 index 23fc8484..00000000 --- a/demos/callout/callout.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 CALLOUT_H -#define CALLOUT_H - -#include <QGraphicsItem> -#include <QFont> - -class QGraphicsSceneMouseEvent; - -class Callout : public QGraphicsItem -{ -public: - Callout(QGraphicsItem * parent = 0); - - void setText(const QString &text); - void setAnchor(QPointF point); - - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - -private: - QString m_text; - QRectF m_textRect; - QRectF m_rect; - QPointF m_anchor; - QFont m_font; -}; - -#endif // CALLOUT_H diff --git a/demos/callout/callout.pro b/demos/callout/callout.pro deleted file mode 100644 index ebe7b466..00000000 --- a/demos/callout/callout.pro +++ /dev/null @@ -1,15 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -TARGET = callout -TEMPLATE = app - -SOURCES += \ - main.cpp\ - callout.cpp \ - view.cpp - -HEADERS += \ - callout.h \ - view.h diff --git a/demos/callout/main.cpp b/demos/callout/main.cpp deleted file mode 100644 index a6dfc2e9..00000000 --- a/demos/callout/main.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "view.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - View w; - w.show(); - - return a.exec(); -} diff --git a/demos/callout/view.cpp b/demos/callout/view.cpp deleted file mode 100644 index a7c43863..00000000 --- a/demos/callout/view.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2014 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 Enterprise Charts Add-on. - ** - ** $QT_BEGIN_LICENSE$ - ** Licensees holding valid Qt Enterprise licenses may use this file in - ** accordance with the Qt Enterprise 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 "view.h" -#include <QResizeEvent> -#include <QGraphicsScene> -#include <QChart> -#include <QLineSeries> -#include <QSplineSeries> -#include <QGraphicsTextItem> -#include "callout.h" -#include <QMouseEvent> - -View::View(QWidget *parent) - : QGraphicsView(new QGraphicsScene, parent), - m_coordX(0), - m_coordY(0), - m_chart(0), - m_tooltip(0) -{ - setDragMode(QGraphicsView::NoDrag); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - - // chart - m_chart = new QChart; - m_chart->setMinimumSize(640, 480); - m_chart->setTitle("Hover the line to show callout. Click the line to make it stay"); - m_chart->legend()->hide(); - QLineSeries *series = new QLineSeries; - series->append(1, 3); - series->append(4, 5); - series->append(5, 4.5); - series->append(7, 1); - series->append(11, 2); - m_chart->addSeries(series); - - QSplineSeries *series2 = new QSplineSeries; - series2->append(1.6, 1.4); - series2->append(2.4, 3.5); - series2->append(3.7, 2.5); - series2->append(7, 4); - series2->append(10, 2); - m_chart->addSeries(series2); - - m_chart->createDefaultAxes(); - m_chart->setAcceptHoverEvents(true); - - setRenderHint(QPainter::Antialiasing); - scene()->addItem(m_chart); - - m_coordX = new QGraphicsSimpleTextItem(m_chart); - m_coordX->setPos(m_chart->size().width()/2 - 50, m_chart->size().height()); - m_coordX->setText("X: "); - m_coordY = new QGraphicsSimpleTextItem(m_chart); - m_coordY->setPos(m_chart->size().width()/2 + 50, m_chart->size().height()); - m_coordY->setText("Y: "); - - connect(series, SIGNAL(clicked(QPointF)), this, SLOT(keepCallout())); - connect(series, SIGNAL(hovered(QPointF, bool)), this, SLOT(tooltip(QPointF,bool))); - - connect(series2, SIGNAL(clicked(QPointF)), this, SLOT(keepCallout())); - connect(series2, SIGNAL(hovered(QPointF, bool)), this, SLOT(tooltip(QPointF,bool))); - - this->setMouseTracking(true); -} - -void View::resizeEvent(QResizeEvent *event) -{ - if (scene()) { - scene()->setSceneRect(QRect(QPoint(0, 0), event->size())); - m_chart->resize(event->size()); - m_coordX->setPos(m_chart->size().width()/2 - 50, m_chart->size().height() - 20); - m_coordY->setPos(m_chart->size().width()/2 + 50, m_chart->size().height() - 20); - } - QGraphicsView::resizeEvent(event); -} - -void View::mouseMoveEvent(QMouseEvent *event) -{ - m_coordX->setText(QString("X: %1").arg(m_chart->mapToValue(event->pos()).x())); - m_coordY->setText(QString("Y: %1").arg(m_chart->mapToValue(event->pos()).y())); - QGraphicsView::mouseMoveEvent(event); -} - -void View::keepCallout() -{ - m_tooltip = new Callout(m_chart); -} - -void View::tooltip(QPointF point, bool state) -{ - if (m_tooltip == 0) - m_tooltip = new Callout(m_chart); - - if (state) { - m_tooltip->setText(QString("X: %1 \nY: %2 ").arg(point.x()).arg(point.y())); - QXYSeries *series = qobject_cast<QXYSeries *>(sender()); - m_tooltip->setAnchor(m_chart->mapToPosition(point, series)); - m_tooltip->setPos(m_chart->mapToPosition(point, series) + QPoint(10, -50)); - m_tooltip->setZValue(11); - m_tooltip->show(); - } else { - m_tooltip->hide(); - } -} diff --git a/demos/callout/view.h b/demos/callout/view.h deleted file mode 100644 index 384e8a89..00000000 --- a/demos/callout/view.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 VIEW_H -#define VIEW_H -#include <QGraphicsView> -#include <QChartGlobal> - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -class QGraphicsScene; -class QResizeEvent; -class Callout; -class QMouseEvent; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class View: public QGraphicsView -{ - Q_OBJECT - -public: - View(QWidget *parent = 0); - -protected: - void resizeEvent(QResizeEvent *event); - void mouseMoveEvent(QMouseEvent *event); - -public slots: - void keepCallout(); - void tooltip(QPointF point, bool state); - -private: - QGraphicsSimpleTextItem *m_coordX; - QGraphicsSimpleTextItem *m_coordY; - QChart *m_chart; - Callout *m_tooltip; -}; - -#endif diff --git a/demos/chartinteractions/chart.cpp b/demos/chartinteractions/chart.cpp deleted file mode 100644 index 8aa2a443..00000000 --- a/demos/chartinteractions/chart.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "chart.h" -#include <QValueAxis> -#include <QAbstractAxis> -#include <qmath.h> - -Chart::Chart(QGraphicsItem *parent, Qt::WindowFlags wFlags, QLineSeries *series) - : QChart(QChart::ChartTypeCartesian, parent, wFlags), m_series(series) -{ - m_clicked = false; -} - -Chart::~Chart() -{ -} - -void Chart::clickPoint(const QPointF &point) -{ - // Find the closes data point - m_movingPoint = QPoint(); - m_clicked = false; - foreach (QPointF p, m_series->points()) { - if (distance(p, point) < distance(m_movingPoint, point)) { - m_movingPoint = p; - m_clicked = true; - } - } -} - -qreal Chart::distance(const QPointF &p1, const QPointF &p2) -{ - return qSqrt((p1.x() - p2.x()) * (p1.x() - p2.x()) - + (p1.y() - p2.y()) * (p1.y() - p2.y())); -} - -void Chart::setPointClicked(bool clicked) -{ - m_clicked = clicked; -} - -void Chart::handlePointMove(const QPoint &point) -{ - if (m_clicked) { - //Map the point clicked from the ChartView - //to the area occupied by the chart. - QPoint mappedPoint = point; - mappedPoint.setX(point.x() - this->plotArea().x()); - mappedPoint.setY(point.y() - this->plotArea().y()); - - //Get the x- and y axis to be able to convert the mapped - //coordinate point to the charts scale. - QAbstractAxis *axisx = this->axisX(); - QValueAxis *haxis = 0; - if (axisx->type() == QAbstractAxis::AxisTypeValue) - haxis = qobject_cast<QValueAxis *>(axisx); - - QAbstractAxis *axisy = this->axisY(); - QValueAxis *vaxis = 0; - if (axisy->type() == QAbstractAxis::AxisTypeValue) - vaxis = qobject_cast<QValueAxis *>(axisy); - - if (haxis && vaxis) { - //Calculate the "unit" between points on the x - //y axis. - double xUnit = this->plotArea().width() / haxis->max(); - double yUnit = this->plotArea().height() / vaxis->max(); - - //Convert the mappedPoint to the actual chart scale. - double x = mappedPoint.x() / xUnit; - double y = vaxis->max() - mappedPoint.y() / yUnit; - - //Replace the old point with the new one. - m_series->replace(m_movingPoint, QPointF(x, y)); - - //Update the m_movingPoint so we are able to - //do the replace also during mousemoveEvent. - m_movingPoint.setX(x); - m_movingPoint.setY(y); - } - } -} - diff --git a/demos/chartinteractions/chart.h b/demos/chartinteractions/chart.h deleted file mode 100644 index 9d94f449..00000000 --- a/demos/chartinteractions/chart.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 CHART_H -#define CHART_H - -#include <QChart> -#include <QLineSeries> - -QTCOMMERCIALCHART_USE_NAMESPACE - -class Chart : public QChart -{ - Q_OBJECT -public: - explicit Chart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0, QLineSeries *series = 0); - ~Chart(); - -public slots: - void clickPoint(const QPointF &point); - -public: - void handlePointMove(const QPoint &point); - void setPointClicked(bool clicked); - -private: - qreal distance(const QPointF &p1, const QPointF &p2); - QLineSeries *m_series; - QPointF m_movingPoint; - - //Boolean value to determine if an actual point in the - //series is clicked. - bool m_clicked; -}; - -#endif // CHART_H diff --git a/demos/chartinteractions/chartinteractions.pro b/demos/chartinteractions/chartinteractions.pro deleted file mode 100644 index b00f2f43..00000000 --- a/demos/chartinteractions/chartinteractions.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ):error( "Couldn't find the demos.pri file!" ) - -QT += core gui - -TARGET = chartinteractions -TEMPLATE = app - -HEADERS += chart.h chartview.h -SOURCES += main.cpp chart.cpp chartview.cpp diff --git a/demos/chartinteractions/chartview.cpp b/demos/chartinteractions/chartview.cpp deleted file mode 100644 index 95fae6cd..00000000 --- a/demos/chartinteractions/chartview.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "chartview.h" -#include <QMouseEvent> -#include "chart.h" - -ChartView::ChartView(Chart *chart, QWidget *parent) : - QChartView(chart, parent) -{ - m_chart = chart; -} - -void ChartView::mousePressEvent(QMouseEvent *event) -{ - m_mousePos = event->pos(); - QChartView::mousePressEvent(event); -} - -void ChartView::mouseMoveEvent(QMouseEvent *event) -{ - m_chart->handlePointMove(event->pos()); - QChartView::mouseMoveEvent(event); -} - -void ChartView::mouseReleaseEvent(QMouseEvent *event) -{ - if (event->pos() != m_mousePos) { - m_chart->handlePointMove(event->pos()); - m_chart->setPointClicked(false); - } - QChartView::mouseReleaseEvent(event); -} diff --git a/demos/chartinteractions/chartview.h b/demos/chartinteractions/chartview.h deleted file mode 100644 index 5623430d..00000000 --- a/demos/chartinteractions/chartview.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 CHARTVIEW_H -#define CHARTVIEW_H - -#include <QChartView> - -class Chart; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class ChartView : public QChartView -{ -public: - ChartView(Chart *chart, QWidget *parent = 0); - -protected: - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - -private: - Chart *m_chart; - QPoint m_mousePos; -}; - -#endif diff --git a/demos/chartinteractions/main.cpp b/demos/chartinteractions/main.cpp deleted file mode 100644 index 9e11d847..00000000 --- a/demos/chartinteractions/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QLineSeries> - -#include <QValueAxis> - -#include "chart.h" -#include "chartview.h" - -QTCOMMERCIALCHART_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - - QLineSeries *series = new QLineSeries(); - - series->append(0, 6); - series->append(1, 3); - series->append(2, 4); - series->append(3, 8); - series->append(7, 13); - series->append(10, 5); - *series << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2); - - Chart *chart = new Chart(0, 0, series); - chart->legend()->hide(); - chart->addSeries(series); - QPen p = series->pen(); - p.setWidth(5); - series->setPen(p); - chart->createDefaultAxes(); - chart->setTitle("Drag'n drop to move data points"); - - QValueAxis *axisX = new QValueAxis(); - chart->setAxisX(axisX, series); - axisX->setRange(0, 20); - - QValueAxis *axisY = new QValueAxis(); - chart->setAxisY(axisY, series); - axisY->setRange(0, 13); - - QObject::connect(series, SIGNAL(clicked(QPointF)), chart, SLOT(clickPoint(QPointF))); - - ChartView *chartView = new ChartView(chart); - chartView->setRenderHint(QPainter::Antialiasing); - - QMainWindow window; - window.setCentralWidget(chartView); - window.resize(400, 300); - window.show(); - - return a.exec(); -} diff --git a/demos/chartthemes/chartthemes.pro b/demos/chartthemes/chartthemes.pro deleted file mode 100644 index d9a61a74..00000000 --- a/demos/chartthemes/chartthemes.pro +++ /dev/null @@ -1,4 +0,0 @@ -!include( ../demos.pri ):error( "Couldn't find the demos.pri file!" ) -TARGET = chartthemes -SOURCES = main.cpp themewidget.cpp -HEADERS = themewidget.h diff --git a/demos/chartthemes/main.cpp b/demos/chartthemes/main.cpp deleted file mode 100644 index 5bc1af84..00000000 --- a/demos/chartthemes/main.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "themewidget.h" -#include <QApplication> -#include <QMainWindow> - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QMainWindow window; - ThemeWidget *widget = new ThemeWidget(); - window.setCentralWidget(widget); - window.resize(900, 600); - window.show(); - return a.exec(); -} - diff --git a/demos/chartthemes/themewidget.cpp b/demos/chartthemes/themewidget.cpp deleted file mode 100644 index d1b0051b..00000000 --- a/demos/chartthemes/themewidget.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "themewidget.h" - -#include <QChartView> -#include <QPieSeries> -#include <QPieSlice> -#include <QAbstractBarSeries> -#include <QPercentBarSeries> -#include <QStackedBarSeries> -#include <QBarSeries> -#include <QBarSet> -#include <QLineSeries> -#include <QSplineSeries> -#include <QScatterSeries> -#include <QAreaSeries> -#include <QLegend> -#include <QGridLayout> -#include <QFormLayout> -#include <QComboBox> -#include <QSpinBox> -#include <QCheckBox> -#include <QGroupBox> -#include <QLabel> -#include <QTime> -#include <QBarCategoryAxis> - -ThemeWidget::ThemeWidget(QWidget *parent) : - QWidget(parent), - m_listCount(3), - m_valueMax(10), - m_valueCount(7), - m_dataTable(generateRandomData(m_listCount, m_valueMax, m_valueCount)), - m_themeComboBox(createThemeBox()), - m_antialiasCheckBox(new QCheckBox("Anti-aliasing")), - m_animatedComboBox(createAnimationBox()), - m_legendComboBox(createLegendBox()) -{ - connectSignals(); - // create layout - QGridLayout *baseLayout = new QGridLayout(); - QHBoxLayout *settingsLayout = new QHBoxLayout(); - settingsLayout->addWidget(new QLabel("Theme:")); - settingsLayout->addWidget(m_themeComboBox); - settingsLayout->addWidget(new QLabel("Animation:")); - settingsLayout->addWidget(m_animatedComboBox); - settingsLayout->addWidget(new QLabel("Legend:")); - settingsLayout->addWidget(m_legendComboBox); - settingsLayout->addWidget(m_antialiasCheckBox); - settingsLayout->addStretch(); - baseLayout->addLayout(settingsLayout, 0, 0, 1, 3); - - //create charts - - QChartView *chartView; - - chartView = new QChartView(createAreaChart()); - baseLayout->addWidget(chartView, 1, 0); - m_charts << chartView; - - chartView = new QChartView(createBarChart(m_valueCount)); - baseLayout->addWidget(chartView, 1, 1); - m_charts << chartView; - - chartView = new QChartView(createLineChart()); - baseLayout->addWidget(chartView, 1, 2); - m_charts << chartView; - - chartView = new QChartView(createPieChart()); - chartView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); // funny things happen if the pie slice labels no not fit the screen... - baseLayout->addWidget(chartView, 2, 0); - m_charts << chartView; - - chartView = new QChartView(createSplineChart()); - baseLayout->addWidget(chartView, 2, 1); - m_charts << chartView; - - chartView = new QChartView(createScatterChart()); - baseLayout->addWidget(chartView, 2, 2); - m_charts << chartView; - - setLayout(baseLayout); - - // Set defaults - m_antialiasCheckBox->setChecked(true); - updateUI(); -} - -ThemeWidget::~ThemeWidget() -{ -} - -void ThemeWidget::connectSignals() -{ - connect(m_themeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - connect(m_antialiasCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateUI())); - connect(m_animatedComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - connect(m_legendComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); -} - -DataTable ThemeWidget::generateRandomData(int listCount, int valueMax, int valueCount) const -{ - DataTable dataTable; - - // set seed for random stuff - qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); - - // generate random data - for (int i(0); i < listCount; i++) { - DataList dataList; - qreal yValue(0); - for (int j(0); j < valueCount; j++) { - yValue = yValue + (qreal)(qrand() % valueMax) / (qreal) valueCount; - QPointF value((j + (qreal) rand() / (qreal) RAND_MAX) * ((qreal) m_valueMax / (qreal) valueCount), - yValue); - QString label = "Slice " + QString::number(i) + ":" + QString::number(j); - dataList << Data(value, label); - } - dataTable << dataList; - } - - return dataTable; -} - -QComboBox *ThemeWidget::createThemeBox() const -{ - // settings layout - QComboBox *themeComboBox = new QComboBox(); - themeComboBox->addItem("Light", QChart::ChartThemeLight); - themeComboBox->addItem("Blue Cerulean", QChart::ChartThemeBlueCerulean); - themeComboBox->addItem("Dark", QChart::ChartThemeDark); - themeComboBox->addItem("Brown Sand", QChart::ChartThemeBrownSand); - themeComboBox->addItem("Blue NCS", QChart::ChartThemeBlueNcs); - themeComboBox->addItem("High Contrast", QChart::ChartThemeHighContrast); - themeComboBox->addItem("Blue Icy", QChart::ChartThemeBlueIcy); - themeComboBox->addItem("Qt", QChart::ChartThemeQt); - return themeComboBox; -} - -QComboBox *ThemeWidget::createAnimationBox() const -{ - // settings layout - QComboBox *animationComboBox = new QComboBox(); - animationComboBox->addItem("No Animations", QChart::NoAnimation); - animationComboBox->addItem("GridAxis Animations", QChart::GridAxisAnimations); - animationComboBox->addItem("Series Animations", QChart::SeriesAnimations); - animationComboBox->addItem("All Animations", QChart::AllAnimations); - return animationComboBox; -} - -QComboBox *ThemeWidget::createLegendBox() const -{ - QComboBox *legendComboBox = new QComboBox(); - legendComboBox->addItem("No Legend ", 0); - legendComboBox->addItem("Legend Top", Qt::AlignTop); - legendComboBox->addItem("Legend Bottom", Qt::AlignBottom); - legendComboBox->addItem("Legend Left", Qt::AlignLeft); - legendComboBox->addItem("Legend Right", Qt::AlignRight); - return legendComboBox; -} - -QChart *ThemeWidget::createAreaChart() const -{ - QChart *chart = new QChart(); - chart->setTitle("Area chart"); - - // The lower series initialized to zero values - QLineSeries *lowerSeries = 0; - QString name("Series "); - int nameIndex = 0; - for (int i(0); i < m_dataTable.count(); i++) { - QLineSeries *upperSeries = new QLineSeries(chart); - for (int j(0); j < m_dataTable[i].count(); j++) { - Data data = m_dataTable[i].at(j); - if (lowerSeries) { - const QList<QPointF>& points = lowerSeries->points(); - upperSeries->append(QPointF(j, points[i].y() + data.first.y())); - } else { - upperSeries->append(QPointF(j, data.first.y())); - } - } - QAreaSeries *area = new QAreaSeries(upperSeries, lowerSeries); - area->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(area); - chart->createDefaultAxes(); - lowerSeries = upperSeries; - } - - return chart; -} - -QChart *ThemeWidget::createBarChart(int valueCount) const -{ - Q_UNUSED(valueCount); - QChart *chart = new QChart(); - chart->setTitle("Bar chart"); - - QStackedBarSeries *series = new QStackedBarSeries(chart); - for (int i(0); i < m_dataTable.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, m_dataTable[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - - return chart; -} - -QChart *ThemeWidget::createLineChart() const -{ - QChart *chart = new QChart(); - chart->setTitle("Line chart"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, m_dataTable) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - chart->createDefaultAxes(); - - return chart; -} - -QChart *ThemeWidget::createPieChart() const -{ - QChart *chart = new QChart(); - chart->setTitle("Pie chart"); - - qreal pieSize = 1.0 / m_dataTable.count(); - for (int i = 0; i < m_dataTable.count(); i++) { - QPieSeries *series = new QPieSeries(chart); - foreach (Data data, m_dataTable[i]) { - QPieSlice *slice = series->append(data.second, data.first.y()); - if (data == m_dataTable[i].first()) { - slice->setLabelVisible(); - slice->setExploded(); - } - } - qreal hPos = (pieSize / 2) + (i / (qreal) m_dataTable.count()); - series->setPieSize(pieSize); - series->setHorizontalPosition(hPos); - series->setVerticalPosition(0.5); - chart->addSeries(series); - } - - return chart; -} - -QChart *ThemeWidget::createSplineChart() const -{ - // spine chart - QChart *chart = new QChart(); - chart->setTitle("Spline chart"); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, m_dataTable) { - QSplineSeries *series = new QSplineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - chart->createDefaultAxes(); - return chart; -} - -QChart *ThemeWidget::createScatterChart() const -{ - // scatter chart - QChart *chart = new QChart(); - chart->setTitle("Scatter chart"); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, m_dataTable) { - QScatterSeries *series = new QScatterSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - chart->createDefaultAxes(); - return chart; -} - -void ThemeWidget::updateUI() -{ - QChart::ChartTheme theme = (QChart::ChartTheme) m_themeComboBox->itemData(m_themeComboBox->currentIndex()).toInt(); - - if (m_charts.at(0)->chart()->theme() != theme) { - foreach (QChartView *chartView, m_charts) - chartView->chart()->setTheme(theme); - - QPalette pal = window()->palette(); - if (theme == QChart::ChartThemeLight) { - pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeDark) { - pal.setColor(QPalette::Window, QRgb(0x121218)); - pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); - } else if (theme == QChart::ChartThemeBlueCerulean) { - pal.setColor(QPalette::Window, QRgb(0x40434a)); - pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); - } else if (theme == QChart::ChartThemeBrownSand) { - pal.setColor(QPalette::Window, QRgb(0x9e8965)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeBlueNcs) { - pal.setColor(QPalette::Window, QRgb(0x018bba)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else if (theme == QChart::ChartThemeHighContrast) { - pal.setColor(QPalette::Window, QRgb(0xffab03)); - pal.setColor(QPalette::WindowText, QRgb(0x181818)); - } else if (theme == QChart::ChartThemeBlueIcy) { - pal.setColor(QPalette::Window, QRgb(0xcee7f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } else { - pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); - pal.setColor(QPalette::WindowText, QRgb(0x404044)); - } - window()->setPalette(pal); - } - - bool checked = m_antialiasCheckBox->isChecked(); - foreach (QChartView *chart, m_charts) - chart->setRenderHint(QPainter::Antialiasing, checked); - - QChart::AnimationOptions options(m_animatedComboBox->itemData(m_animatedComboBox->currentIndex()).toInt()); - if (m_charts.at(0)->chart()->animationOptions() != options) { - foreach (QChartView *chartView, m_charts) - chartView->chart()->setAnimationOptions(options); - } - - Qt::Alignment alignment(m_legendComboBox->itemData(m_legendComboBox->currentIndex()).toInt()); - - if (!alignment) { - foreach (QChartView *chartView, m_charts) - chartView->chart()->legend()->hide(); - } else { - foreach (QChartView *chartView, m_charts) { - chartView->chart()->legend()->setAlignment(alignment); - chartView->chart()->legend()->show(); - } - } -} - diff --git a/demos/chartthemes/themewidget.h b/demos/chartthemes/themewidget.h deleted file mode 100644 index 4b1b677c..00000000 --- a/demos/chartthemes/themewidget.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 THEMEWIDGET_H -#define THEMEWIDGET_H - -#include <QWidget> -#include <QChartGlobal> - -class QComboBox; -class QCheckBox; - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartView; -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -typedef QPair<QPointF, QString> Data; -typedef QList<Data> DataList; -typedef QList<DataList> DataTable; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class ThemeWidget: public QWidget -{ - Q_OBJECT -public: - explicit ThemeWidget(QWidget *parent = 0); - ~ThemeWidget(); - -private Q_SLOTS: - void updateUI(); - -private: - DataTable generateRandomData(int listCount, int valueMax, int valueCount) const; - QComboBox *createThemeBox() const; - QComboBox *createAnimationBox() const; - QComboBox *createLegendBox() const; - void connectSignals(); - QChart *createAreaChart() const; - QChart *createBarChart(int valueCount) const; - QChart *createPieChart() const; - QChart *createLineChart() const; - QChart *createSplineChart() const; - QChart *createScatterChart() const; - -private: - int m_listCount; - int m_valueMax; - int m_valueCount; - QList<QChartView *> m_charts; - DataTable m_dataTable; - - QComboBox *m_themeComboBox; - QCheckBox *m_antialiasCheckBox; - QComboBox *m_animatedComboBox; - QComboBox *m_legendComboBox; -}; - -#endif /* THEMEWIDGET_H */ diff --git a/demos/demos.pri b/demos/demos.pri deleted file mode 100644 index e96d687c..00000000 --- a/demos/demos.pri +++ /dev/null @@ -1,39 +0,0 @@ -!include( ../config.pri ) { - error( "Couldn't find the config.pri file!" ) -} - -DESTDIR = $$CHART_BUILD_BIN_DIR -!ios { -OBJECTS_DIR = $$CHART_BUILD_DIR/demos/$$TARGET -MOC_DIR = $$CHART_BUILD_DIR/demos/$$TARGET -UI_DIR = $$CHART_BUILD_DIR/demos/$$TARGET -RCC_DIR = $$CHART_BUILD_DIR/demos/$$TARGET -} -TEMPLATE = app -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -# staticlib config causes problems when building executables -staticlib: CONFIG-=staticlib - -android { - # Workaround to fix android deployment, which seems to always look for target in - # OUT_PWD instead of DESTDIR. - COPY_PARAMETERS = "$$CHART_BUILD_BIN_DIR/lib$${TARGET}.so $$OUT_PWD/lib$${TARGET}.so" - contains(QMAKE_HOST.os, Windows): COPY_PARAMETERS = $$replace(COPY_PARAMETERS, "/","\\") - QMAKE_POST_LINK += $$QMAKE_COPY $$COPY_PARAMETERS - - contains(TARGET, qml.*) { - charts_qmldir.files = $$CHART_BUILD_QML_PLUGIN_DIR/qmldir - charts_qmldir.path = /assets/imports/QtCommercial/Chart - charts_qmlplugin.files = $$CHART_BUILD_QML_PLUGIN_DIR/libqtcommercialchartqml.so - charts_qmlplugin.path = /libs/$$ANDROID_TARGET_ARCH - INSTALLS += charts_qmldir charts_qmlplugin - } else:contains(TARGET, quick2.*) { - charts_qmldir.files = $$CHART_BUILD_QML2_PLUGIN_DIR/qmldir - charts_qmldir.path = /assets/qml/QtCommercial/Chart - charts_qmlplugin.files = $$CHART_BUILD_QML2_PLUGIN_DIR/libqtcommercialchartqml2.so - charts_qmlplugin.path = /libs/$$ANDROID_TARGET_ARCH - INSTALLS += charts_qmldir charts_qmlplugin - } -} diff --git a/demos/demos.pro b/demos/demos.pro deleted file mode 100644 index 98937905..00000000 --- a/demos/demos.pro +++ /dev/null @@ -1,34 +0,0 @@ -CURRENTLY_BUILDING_COMPONENTS = "demos" -!include( ../config.pri ) { - error( "Couldn't find the config.pri file!" ) -} - -TEMPLATE = subdirs -SUBDIRS += piechartcustomization \ - dynamicspline \ - nesteddonuts \ - chartinteractions \ - callout \ - chartthemes - -!contains(QT_VERSION, ^5\\..*\\..*$)|qtHaveModule(declarative) { - SUBDIRS += qmlchart \ - qmlweather \ - qmlf1legends \ - qmlcustomizations \ - qmlaxes \ - qmlcustomlegend \ - qmlpolarchart \ - qmloscilloscope -} - -contains(QT_CONFIG, multimedia) { - SUBDIRS += audio -} else { - message("QtMultimedia library not available. Some demos are disabled") -} - -contains(QT_VERSION, ^5\\..*\\..*$):qtHaveModule(quick) { - SUBDIRS += quick2chart \ - quick2oscilloscope -} diff --git a/demos/dynamicspline/chart.cpp b/demos/dynamicspline/chart.cpp deleted file mode 100644 index 4c7bc355..00000000 --- a/demos/dynamicspline/chart.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "chart.h" -#include <QAbstractAxis> -#include <QSplineSeries> -#include <QValueAxis> -#include <QTime> -#include <QDebug> - -Chart::Chart(QGraphicsItem *parent, Qt::WindowFlags wFlags): - QChart(QChart::ChartTypeCartesian, parent, wFlags), - m_series(0), - m_axis(new QValueAxis), - m_step(0), - m_x(5), - m_y(1) -{ - qsrand((uint) QTime::currentTime().msec()); - - QObject::connect(&m_timer, SIGNAL(timeout()), this, SLOT(handleTimeout())); - m_timer.setInterval(1000); - - m_series = new QSplineSeries(this); - QPen green(Qt::red); - green.setWidth(3); - m_series->setPen(green); - m_series->append(m_x, m_y); - - addSeries(m_series); - createDefaultAxes(); - setAxisX(m_axis, m_series); - m_axis->setTickCount(5); - axisX()->setRange(0, 10); - axisY()->setRange(-5, 10); - - m_timer.start(); -} - -Chart::~Chart() -{ - -} - -void Chart::handleTimeout() -{ - qreal x = plotArea().width() / m_axis->tickCount(); - qreal y = (m_axis->max() - m_axis->min()) / m_axis->tickCount(); - m_x += y; - m_y = qrand() % 5 - 2.5; - m_series->append(m_x, m_y); - scroll(x, 0); - if (m_x == 100) - m_timer.stop(); -} diff --git a/demos/dynamicspline/chart.h b/demos/dynamicspline/chart.h deleted file mode 100644 index 2908310f..00000000 --- a/demos/dynamicspline/chart.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 CHART_H -#define CHART_H - -#include <QChart> -#include <QTimer> - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QSplineSeries; -class QValueAxis; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -//![1] -class Chart: public QChart -{ - Q_OBJECT -public: - Chart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); - virtual ~Chart(); - -public slots: - void handleTimeout(); - -private: - QTimer m_timer; - QSplineSeries *m_series; - QStringList m_titles; - QValueAxis *m_axis; - qreal m_step; - qreal m_x; - qreal m_y; -}; -//![1] - -#endif /* CHART_H */ diff --git a/demos/dynamicspline/dynamicspline.pro b/demos/dynamicspline/dynamicspline.pro deleted file mode 100644 index 697a864e..00000000 --- a/demos/dynamicspline/dynamicspline.pro +++ /dev/null @@ -1,4 +0,0 @@ -!include( ../demos.pri ):error( "Couldn't find the demos.pri file!" ) -TARGET = dynamicspline -HEADERS += chart.h -SOURCES += main.cpp chart.cpp diff --git a/demos/dynamicspline/main.cpp b/demos/dynamicspline/main.cpp deleted file mode 100644 index 326e635d..00000000 --- a/demos/dynamicspline/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "chart.h" -#include <QChartView> -#include <QApplication> -#include <QMainWindow> - -QTCOMMERCIALCHART_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QMainWindow window; - Chart *chart = new Chart; - chart->setTitle("Dynamic spline chart"); - chart->legend()->hide(); - chart->setAnimationOptions(QChart::AllAnimations); - QChartView chartView(chart); - chartView.setRenderHint(QPainter::Antialiasing); - window.setCentralWidget(&chartView); - window.resize(400, 300); - window.show(); - return a.exec(); -} diff --git a/demos/nesteddonuts/main.cpp b/demos/nesteddonuts/main.cpp deleted file mode 100644 index 0b833a83..00000000 --- a/demos/nesteddonuts/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "widget.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - Widget w; - w.show(); - return a.exec(); -} diff --git a/demos/nesteddonuts/nesteddonuts.pro b/demos/nesteddonuts/nesteddonuts.pro deleted file mode 100644 index 2da71e11..00000000 --- a/demos/nesteddonuts/nesteddonuts.pro +++ /dev/null @@ -1,8 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -TARGET = nesteddonuts -SOURCES += main.cpp\ - widget.cpp -HEADERS += widget.h diff --git a/demos/nesteddonuts/widget.cpp b/demos/nesteddonuts/widget.cpp deleted file mode 100644 index fdde6a64..00000000 --- a/demos/nesteddonuts/widget.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "widget.h" -#include <QChartView> -#include <QChart> -#include <QLegend> -#include <QPieSeries> -#include <QPieSlice> -#include <QTime> -#include <QGridLayout> -#include <QTimer> - -QTCOMMERCIALCHART_USE_NAMESPACE - -Widget::Widget(QWidget *parent) - : QWidget(parent) -{ - setMinimumSize(800, 600); - qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); - - //! [1] - QChartView *chartView = new QChartView; - chartView->setRenderHint(QPainter::Antialiasing); - QChart *chart = chartView->chart(); - chart->legend()->setVisible(false); - chart->setTitle("Nested donuts demo"); - chart->setAnimationOptions(QChart::AllAnimations); - //! [1] - - //! [2] - qreal minSize = 0.1; - qreal maxSize = 0.9; - int donutCount = 5; - //! [2] - - //! [3] - for (int i = 0; i < donutCount; i++) { - QPieSeries *donut = new QPieSeries; - int sliceCount = 3 + qrand() % 3; - for (int j = 0; j < sliceCount; j++) { - qreal value = 100 + qrand() % 100; - QPieSlice *slice = new QPieSlice(QString("%1").arg(value), value); - slice->setLabelVisible(true); - slice->setLabelColor(Qt::white); - slice->setLabelPosition(QPieSlice::LabelInsideTangential); - connect(slice, SIGNAL(hovered(bool)), this, SLOT(explodeSlice(bool))); - donut->append(slice); - donut->setHoleSize(minSize + i * (maxSize - minSize) / donutCount); - donut->setPieSize(minSize + (i + 1) * (maxSize - minSize) / donutCount); - } - m_donuts.append(donut); - chartView->chart()->addSeries(donut); - } - //! [3] - - // create main layout - //! [4] - QGridLayout *mainLayout = new QGridLayout; - mainLayout->addWidget(chartView, 1, 1); - setLayout(mainLayout); - //! [4] - - //! [5] - updateTimer = new QTimer(this); - connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateRotation())); - updateTimer->start(1250); - //! [5] -} - -Widget::~Widget() -{ - -} - -//! [6] -void Widget::updateRotation() -{ - for (int i = 0; i < m_donuts.count(); i++) { - QPieSeries *donut = m_donuts.at(i); - qreal phaseShift = -50 + qrand() % 100; - donut->setPieStartAngle(donut->pieStartAngle() + phaseShift); - donut->setPieEndAngle(donut->pieEndAngle() + phaseShift); - } -} -//! [6] - -//! [7] -void Widget::explodeSlice(bool exploded) -{ - QPieSlice *slice = qobject_cast<QPieSlice *>(sender()); - if (exploded) { - updateTimer->stop(); - qreal sliceStartAngle = slice->startAngle(); - qreal sliceEndAngle = slice->startAngle() + slice->angleSpan(); - - QPieSeries *donut = slice->series(); - qreal seriesIndex = m_donuts.indexOf(donut); - for (int i = seriesIndex + 1; i < m_donuts.count(); i++) { - m_donuts.at(i)->setPieStartAngle(sliceEndAngle); - m_donuts.at(i)->setPieEndAngle(360 + sliceStartAngle); - } - } else { - for (int i = 0; i < m_donuts.count(); i++) { - m_donuts.at(i)->setPieStartAngle(0); - m_donuts.at(i)->setPieEndAngle(360); - } - updateTimer->start(); - } - slice->setExploded(exploded); -} -//! [7] diff --git a/demos/nesteddonuts/widget.h b/demos/nesteddonuts/widget.h deleted file mode 100644 index d9ba46ab..00000000 --- a/demos/nesteddonuts/widget.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 WIDGET_H -#define WIDGET_H - -#include <QWidget> -#include <QPieSeries> - -class QTimer; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class Widget : public QWidget -{ - Q_OBJECT - -public: - Widget(QWidget *parent = 0); - ~Widget(); - -public slots: - void updateRotation(); - void explodeSlice(bool exploded); - -private: - QList<QPieSeries *> m_donuts; - QTimer *updateTimer; -}; - -#endif // WIDGET_H diff --git a/demos/piechartcustomization/brushtool.cpp b/demos/piechartcustomization/brushtool.cpp deleted file mode 100644 index 08dff95a..00000000 --- a/demos/piechartcustomization/brushtool.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "brushtool.h" -#include <QPushButton> -#include <QFormLayout> -#include <QComboBox> -#include <QColorDialog> - -BrushTool::BrushTool(QString title, QWidget *parent) - : QWidget(parent) -{ - setWindowTitle(title); - setWindowFlags(Qt::Tool); - - m_colorButton = new QPushButton(); - m_styleCombo = new QComboBox(); - m_styleCombo->addItem("Nobrush", (int) Qt::NoBrush); - m_styleCombo->addItem("Solidpattern", (int) Qt::SolidPattern); - m_styleCombo->addItem("Dense1pattern", (int) Qt::Dense1Pattern); - m_styleCombo->addItem("Dense2attern", (int) Qt::Dense2Pattern); - m_styleCombo->addItem("Dense3Pattern", (int) Qt::Dense3Pattern); - m_styleCombo->addItem("Dense4Pattern", (int) Qt::Dense4Pattern); - m_styleCombo->addItem("Dense5Pattern", (int) Qt::Dense5Pattern); - m_styleCombo->addItem("Dense6Pattern", (int) Qt::Dense6Pattern); - m_styleCombo->addItem("Dense7Pattern", (int) Qt::Dense7Pattern); - m_styleCombo->addItem("HorPattern", (int) Qt::HorPattern); - m_styleCombo->addItem("VerPattern", (int) Qt::VerPattern); - m_styleCombo->addItem("CrossPattern", (int) Qt::CrossPattern); - m_styleCombo->addItem("BDiagPattern", (int) Qt::BDiagPattern); - m_styleCombo->addItem("FDiagPattern", (int) Qt::FDiagPattern); - m_styleCombo->addItem("DiagCrossPattern", (int) Qt::DiagCrossPattern); - - QFormLayout *layout = new QFormLayout(); - layout->addRow("Color", m_colorButton); - layout->addRow("Style", m_styleCombo); - setLayout(layout); - - connect(m_colorButton, SIGNAL(clicked()), this, SLOT(showColorDialog())); - connect(m_styleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStyle())); -} - -void BrushTool::setBrush(QBrush brush) -{ - m_brush = brush; - m_colorButton->setText(m_brush.color().name()); - m_styleCombo->setCurrentIndex(m_brush.style()); // index matches the enum -} - -QBrush BrushTool::brush() const -{ - return m_brush; -} - -QString BrushTool::name() -{ - return name(m_brush); -} - -QString BrushTool::name(const QBrush &brush) -{ - return brush.color().name(); -} - -void BrushTool::showColorDialog() -{ - QColorDialog dialog(m_brush.color()); - dialog.show(); - dialog.exec(); - m_brush.setColor(dialog.selectedColor()); - m_colorButton->setText(m_brush.color().name()); - emit changed(); -} - -void BrushTool::updateStyle() -{ - Qt::BrushStyle style = (Qt::BrushStyle) m_styleCombo->itemData(m_styleCombo->currentIndex()).toInt(); - if (m_brush.style() != style) { - m_brush.setStyle(style); - emit changed(); - } -} - -#include "moc_brushtool.cpp" diff --git a/demos/piechartcustomization/brushtool.h b/demos/piechartcustomization/brushtool.h deleted file mode 100644 index f6e31b72..00000000 --- a/demos/piechartcustomization/brushtool.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 BRUSHTOOL_H -#define BRUSHTOOL_H - -#include <QWidget> -#include <QBrush> - -class QPushButton; -class QComboBox; - -class BrushTool : public QWidget -{ - Q_OBJECT - -public: - explicit BrushTool(QString title, QWidget *parent = 0); - void setBrush(QBrush brush); - QBrush brush() const; - QString name(); - static QString name(const QBrush &brush); - -Q_SIGNALS: - void changed(); - -public Q_SLOTS: - void showColorDialog(); - void updateStyle(); - -private: - QBrush m_brush; - QPushButton *m_colorButton; - QComboBox *m_styleCombo; -}; - -#endif // BRUSHTOOL_H diff --git a/demos/piechartcustomization/customslice.cpp b/demos/piechartcustomization/customslice.cpp deleted file mode 100644 index 5ccfe53c..00000000 --- a/demos/piechartcustomization/customslice.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "customslice.h" - -QTCOMMERCIALCHART_USE_NAMESPACE - -CustomSlice::CustomSlice(QString label, qreal value) - : QPieSlice(label, value) -{ - connect(this, SIGNAL(hovered(bool)), this, SLOT(showHighlight(bool))); -} - -QBrush CustomSlice::originalBrush() -{ - return m_originalBrush; -} - -void CustomSlice::showHighlight(bool show) -{ - if (show) { - QBrush brush = this->brush(); - m_originalBrush = brush; - brush.setColor(brush.color().lighter()); - setBrush(brush); - } else { - setBrush(m_originalBrush); - } -} - -#include "moc_customslice.cpp" diff --git a/demos/piechartcustomization/customslice.h b/demos/piechartcustomization/customslice.h deleted file mode 100644 index 61ae8630..00000000 --- a/demos/piechartcustomization/customslice.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 CUSTOMSLICE_H -#define CUSTOMSLICE_H - -#include <QPieSlice> - -QTCOMMERCIALCHART_USE_NAMESPACE - -class CustomSlice : public QPieSlice -{ - Q_OBJECT - -public: - CustomSlice(QString label, qreal value); - -public: - QBrush originalBrush(); - -public Q_SLOTS: - void showHighlight(bool show); - -private: - QBrush m_originalBrush; -}; - -#endif // CUSTOMSLICE_H diff --git a/demos/piechartcustomization/main.cpp b/demos/piechartcustomization/main.cpp deleted file mode 100644 index f35fd0fc..00000000 --- a/demos/piechartcustomization/main.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "mainwidget.h" -#include <QApplication> -#include <QMainWindow> - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QMainWindow window; - MainWidget widget; - window.setCentralWidget(&widget); - window.resize(900, 600); - window.show(); - return a.exec(); -} diff --git a/demos/piechartcustomization/mainwidget.cpp b/demos/piechartcustomization/mainwidget.cpp deleted file mode 100644 index b984ba55..00000000 --- a/demos/piechartcustomization/mainwidget.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "mainwidget.h" -#include "customslice.h" -#include "pentool.h" -#include "brushtool.h" -#include <QPushButton> -#include <QComboBox> -#include <QCheckBox> -#include <QLineEdit> -#include <QGroupBox> -#include <QDoubleSpinBox> -#include <QFormLayout> -#include <QFontDialog> -#include <QChartView> -#include <QPieSeries> - -QTCOMMERCIALCHART_USE_NAMESPACE - -MainWidget::MainWidget(QWidget *parent) - : QWidget(parent), - m_slice(0) -{ - // create chart - QChart *chart = new QChart; - chart->setTitle("Piechart customization"); - chart->setAnimationOptions(QChart::AllAnimations); - - // create series - m_series = new QPieSeries(); - *m_series << new CustomSlice("Slice 1", 10.0); - *m_series << new CustomSlice("Slice 2", 20.0); - *m_series << new CustomSlice("Slice 3", 30.0); - *m_series << new CustomSlice("Slice 4", 40.0); - *m_series << new CustomSlice("Slice 5", 50.0); - m_series->setLabelsVisible(); - chart->addSeries(m_series); - - connect(m_series, SIGNAL(clicked(QPieSlice*)), this, SLOT(handleSliceClicked(QPieSlice*))); - - // chart settings - m_themeComboBox = new QComboBox(); - m_themeComboBox->addItem("Light", QChart::ChartThemeLight); - m_themeComboBox->addItem("BlueCerulean", QChart::ChartThemeBlueCerulean); - m_themeComboBox->addItem("Dark", QChart::ChartThemeDark); - m_themeComboBox->addItem("BrownSand", QChart::ChartThemeBrownSand); - m_themeComboBox->addItem("BlueNcs", QChart::ChartThemeBlueNcs); - m_themeComboBox->addItem("High Contrast", QChart::ChartThemeHighContrast); - m_themeComboBox->addItem("Blue Icy", QChart::ChartThemeBlueIcy); - m_themeComboBox->addItem("Qt", QChart::ChartThemeQt); - - m_aaCheckBox = new QCheckBox(); - m_animationsCheckBox = new QCheckBox(); - m_animationsCheckBox->setCheckState(Qt::Checked); - - m_legendCheckBox = new QCheckBox(); - - QFormLayout *chartSettingsLayout = new QFormLayout(); - chartSettingsLayout->addRow("Theme", m_themeComboBox); - chartSettingsLayout->addRow("Antialiasing", m_aaCheckBox); - chartSettingsLayout->addRow("Animations", m_animationsCheckBox); - chartSettingsLayout->addRow("Legend", m_legendCheckBox); - QGroupBox *chartSettings = new QGroupBox("Chart"); - chartSettings->setLayout(chartSettingsLayout); - - connect(m_themeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateChartSettings())); - connect(m_aaCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateChartSettings())); - connect(m_animationsCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateChartSettings())); - connect(m_legendCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateChartSettings())); - - // series settings - m_hPosition = new QDoubleSpinBox(); - m_hPosition->setMinimum(0.0); - m_hPosition->setMaximum(1.0); - m_hPosition->setSingleStep(0.1); - m_hPosition->setValue(m_series->horizontalPosition()); - - m_vPosition = new QDoubleSpinBox(); - m_vPosition->setMinimum(0.0); - m_vPosition->setMaximum(1.0); - m_vPosition->setSingleStep(0.1); - m_vPosition->setValue(m_series->verticalPosition()); - - m_sizeFactor = new QDoubleSpinBox(); - m_sizeFactor->setMinimum(0.0); - m_sizeFactor->setMaximum(1.0); - m_sizeFactor->setSingleStep(0.1); - m_sizeFactor->setValue(m_series->pieSize()); - - m_startAngle = new QDoubleSpinBox(); - m_startAngle->setMinimum(-720); - m_startAngle->setMaximum(720); - m_startAngle->setValue(m_series->pieStartAngle()); - m_startAngle->setSingleStep(1); - - m_endAngle = new QDoubleSpinBox(); - m_endAngle->setMinimum(-720); - m_endAngle->setMaximum(720); - m_endAngle->setValue(m_series->pieEndAngle()); - m_endAngle->setSingleStep(1); - - m_holeSize = new QDoubleSpinBox(); - m_holeSize->setMinimum(0.0); - m_holeSize->setMaximum(1.0); - m_holeSize->setSingleStep(0.1); - m_holeSize->setValue(m_series->holeSize()); - - QPushButton *appendSlice = new QPushButton("Append slice"); - QPushButton *insertSlice = new QPushButton("Insert slice"); - QPushButton *removeSlice = new QPushButton("Remove selected slice"); - - QFormLayout *seriesSettingsLayout = new QFormLayout(); - seriesSettingsLayout->addRow("Horizontal position", m_hPosition); - seriesSettingsLayout->addRow("Vertical position", m_vPosition); - seriesSettingsLayout->addRow("Size factor", m_sizeFactor); - seriesSettingsLayout->addRow("Start angle", m_startAngle); - seriesSettingsLayout->addRow("End angle", m_endAngle); - seriesSettingsLayout->addRow("Hole size", m_holeSize); - seriesSettingsLayout->addRow(appendSlice); - seriesSettingsLayout->addRow(insertSlice); - seriesSettingsLayout->addRow(removeSlice); - QGroupBox *seriesSettings = new QGroupBox("Series"); - seriesSettings->setLayout(seriesSettingsLayout); - - connect(m_vPosition, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(m_hPosition, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(m_sizeFactor, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(m_startAngle, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(m_endAngle, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(m_holeSize, SIGNAL(valueChanged(double)), this, SLOT(updateSerieSettings())); - connect(appendSlice, SIGNAL(clicked()), this, SLOT(appendSlice())); - connect(insertSlice, SIGNAL(clicked()), this, SLOT(insertSlice())); - connect(removeSlice, SIGNAL(clicked()), this, SLOT(removeSlice())); - - // slice settings - m_sliceName = new QLineEdit("<click a slice>"); - m_sliceName->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - m_sliceValue = new QDoubleSpinBox(); - m_sliceValue->setMaximum(1000); - m_sliceLabelVisible = new QCheckBox(); - m_sliceLabelArmFactor = new QDoubleSpinBox(); - m_sliceLabelArmFactor->setSingleStep(0.01); - m_sliceExploded = new QCheckBox(); - m_sliceExplodedFactor = new QDoubleSpinBox(); - m_sliceExplodedFactor->setSingleStep(0.01); - m_pen = new QPushButton(); - m_penTool = new PenTool("Slice pen", this); - m_brush = new QPushButton(); - m_brushTool = new BrushTool("Slice brush", this); - m_font = new QPushButton(); - m_labelBrush = new QPushButton(); - m_labelBrushTool = new BrushTool("Label brush", this); - m_labelPosition = new QComboBox(this); - m_labelPosition->addItem("Outside", QPieSlice::LabelOutside); - m_labelPosition->addItem("Inside horizontal", QPieSlice::LabelInsideHorizontal); - m_labelPosition->addItem("Inside tangential", QPieSlice::LabelInsideTangential); - m_labelPosition->addItem("Inside normal", QPieSlice::LabelInsideNormal); - - QFormLayout *sliceSettingsLayout = new QFormLayout(); - sliceSettingsLayout->addRow("Label", m_sliceName); - sliceSettingsLayout->addRow("Value", m_sliceValue); - sliceSettingsLayout->addRow("Pen", m_pen); - sliceSettingsLayout->addRow("Brush", m_brush); - sliceSettingsLayout->addRow("Label visible", m_sliceLabelVisible); - sliceSettingsLayout->addRow("Label font", m_font); - sliceSettingsLayout->addRow("Label brush", m_labelBrush); - sliceSettingsLayout->addRow("Label position", m_labelPosition); - sliceSettingsLayout->addRow("Label arm length", m_sliceLabelArmFactor); - sliceSettingsLayout->addRow("Exploded", m_sliceExploded); - sliceSettingsLayout->addRow("Explode distance", m_sliceExplodedFactor); - QGroupBox *sliceSettings = new QGroupBox("Selected slice"); - sliceSettings->setLayout(sliceSettingsLayout); - - connect(m_sliceName, SIGNAL(textChanged(QString)), this, SLOT(updateSliceSettings())); - connect(m_sliceValue, SIGNAL(valueChanged(double)), this, SLOT(updateSliceSettings())); - connect(m_pen, SIGNAL(clicked()), m_penTool, SLOT(show())); - connect(m_penTool, SIGNAL(changed()), this, SLOT(updateSliceSettings())); - connect(m_brush, SIGNAL(clicked()), m_brushTool, SLOT(show())); - connect(m_brushTool, SIGNAL(changed()), this, SLOT(updateSliceSettings())); - connect(m_font, SIGNAL(clicked()), this, SLOT(showFontDialog())); - connect(m_labelBrush, SIGNAL(clicked()), m_labelBrushTool, SLOT(show())); - connect(m_labelBrushTool, SIGNAL(changed()), this, SLOT(updateSliceSettings())); - connect(m_sliceLabelVisible, SIGNAL(toggled(bool)), this, SLOT(updateSliceSettings())); - connect(m_sliceLabelVisible, SIGNAL(toggled(bool)), this, SLOT(updateSliceSettings())); - connect(m_sliceLabelArmFactor, SIGNAL(valueChanged(double)), this, SLOT(updateSliceSettings())); - connect(m_sliceExploded, SIGNAL(toggled(bool)), this, SLOT(updateSliceSettings())); - connect(m_sliceExplodedFactor, SIGNAL(valueChanged(double)), this, SLOT(updateSliceSettings())); - connect(m_labelPosition, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSliceSettings())); - - // create chart view - m_chartView = new QChartView(chart); - - // create main layout - QVBoxLayout *settingsLayout = new QVBoxLayout(); - settingsLayout->addWidget(chartSettings); - settingsLayout->addWidget(seriesSettings); - settingsLayout->addWidget(sliceSettings); - settingsLayout->addStretch(); - - QGridLayout *baseLayout = new QGridLayout(); - baseLayout->addLayout(settingsLayout, 0, 0); - baseLayout->addWidget(m_chartView, 0, 1); - setLayout(baseLayout); - - updateSerieSettings(); - updateChartSettings(); -} - - -void MainWidget::updateChartSettings() -{ - QChart::ChartTheme theme = (QChart::ChartTheme) m_themeComboBox->itemData(m_themeComboBox->currentIndex()).toInt(); - m_chartView->chart()->setTheme(theme); - m_chartView->setRenderHint(QPainter::Antialiasing, m_aaCheckBox->isChecked()); - - if (m_animationsCheckBox->checkState() == Qt::Checked) - m_chartView->chart()->setAnimationOptions(QChart::AllAnimations); - else - m_chartView->chart()->setAnimationOptions(QChart::NoAnimation); - - if (m_legendCheckBox->checkState() == Qt::Checked) - m_chartView->chart()->legend()->show(); - else - m_chartView->chart()->legend()->hide(); -} - -void MainWidget::updateSerieSettings() -{ - m_series->setHorizontalPosition(m_hPosition->value()); - m_series->setVerticalPosition(m_vPosition->value()); - m_series->setPieSize(m_sizeFactor->value()); - m_holeSize->setMaximum(m_sizeFactor->value()); - m_series->setPieStartAngle(m_startAngle->value()); - m_series->setPieEndAngle(m_endAngle->value()); - m_series->setHoleSize(m_holeSize->value()); -} - -void MainWidget::updateSliceSettings() -{ - if (!m_slice) - return; - - m_slice->setLabel(m_sliceName->text()); - - m_slice->setValue(m_sliceValue->value()); - - m_slice->setPen(m_penTool->pen()); - m_slice->setBrush(m_brushTool->brush()); - - m_slice->setLabelBrush(m_labelBrushTool->brush()); - m_slice->setLabelVisible(m_sliceLabelVisible->isChecked()); - m_slice->setLabelArmLengthFactor(m_sliceLabelArmFactor->value()); - m_slice->setLabelPosition((QPieSlice::LabelPosition)m_labelPosition->currentIndex()); // assumes that index is in sync with the enum - - m_slice->setExploded(m_sliceExploded->isChecked()); - m_slice->setExplodeDistanceFactor(m_sliceExplodedFactor->value()); -} - -void MainWidget::handleSliceClicked(QPieSlice *slice) -{ - m_slice = static_cast<CustomSlice *>(slice); - - // name - m_sliceName->blockSignals(true); - m_sliceName->setText(slice->label()); - m_sliceName->blockSignals(false); - - // value - m_sliceValue->blockSignals(true); - m_sliceValue->setValue(slice->value()); - m_sliceValue->blockSignals(false); - - // pen - m_pen->setText(PenTool::name(m_slice->pen())); - m_penTool->setPen(m_slice->pen()); - - // brush - m_brush->setText(m_slice->originalBrush().color().name()); - m_brushTool->setBrush(m_slice->originalBrush()); - - // label - m_labelBrush->setText(BrushTool::name(m_slice->labelBrush())); - m_labelBrushTool->setBrush(m_slice->labelBrush()); - m_font->setText(slice->labelFont().toString()); - m_sliceLabelVisible->blockSignals(true); - m_sliceLabelVisible->setChecked(slice->isLabelVisible()); - m_sliceLabelVisible->blockSignals(false); - m_sliceLabelArmFactor->blockSignals(true); - m_sliceLabelArmFactor->setValue(slice->labelArmLengthFactor()); - m_sliceLabelArmFactor->blockSignals(false); - m_labelPosition->blockSignals(true); - m_labelPosition->setCurrentIndex(slice->labelPosition()); // assumes that index is in sync with the enum - m_labelPosition->blockSignals(false); - - // exploded - m_sliceExploded->blockSignals(true); - m_sliceExploded->setChecked(slice->isExploded()); - m_sliceExploded->blockSignals(false); - m_sliceExplodedFactor->blockSignals(true); - m_sliceExplodedFactor->setValue(slice->explodeDistanceFactor()); - m_sliceExplodedFactor->blockSignals(false); -} - -void MainWidget::showFontDialog() -{ - if (!m_slice) - return; - - QFontDialog dialog(m_slice->labelFont()); - dialog.show(); - dialog.exec(); - - m_slice->setLabelFont(dialog.currentFont()); - m_font->setText(dialog.currentFont().toString()); -} - -void MainWidget::appendSlice() -{ - *m_series << new CustomSlice("Slice " + QString::number(m_series->count() + 1), 10.0); -} - -void MainWidget::insertSlice() -{ - if (!m_slice) - return; - - int i = m_series->slices().indexOf(m_slice); - - m_series->insert(i, new CustomSlice("Slice " + QString::number(m_series->count() + 1), 10.0)); -} - -void MainWidget::removeSlice() -{ - if (!m_slice) - return; - - m_sliceName->setText("<click a slice>"); - - m_series->remove(m_slice); - m_slice = 0; -} - -#include "moc_mainwidget.cpp" diff --git a/demos/piechartcustomization/mainwidget.h b/demos/piechartcustomization/mainwidget.h deleted file mode 100644 index 07fcd034..00000000 --- a/demos/piechartcustomization/mainwidget.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 MAINWIDGET_H -#define MAINWIDGET_H - -#include <QWidget> -#include <QChartGlobal> - -class QLineEdit; -class QPushButton; -class QCheckBox; -class QComboBox; -class QDoubleSpinBox; -class PenTool; -class BrushTool; -class CustomSlice; - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartView; -class QPieSeries; -class QPieSlice; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -class MainWidget : public QWidget -{ - Q_OBJECT - -public: - explicit MainWidget(QWidget *parent = 0); - -public Q_SLOTS: - void updateChartSettings(); - void updateSerieSettings(); - void updateSliceSettings(); - void handleSliceClicked(QPieSlice *slice); - void showFontDialog(); - void appendSlice(); - void insertSlice(); - void removeSlice(); - -private: - QComboBox *m_themeComboBox; - QCheckBox *m_aaCheckBox; - QCheckBox *m_animationsCheckBox; - QCheckBox *m_legendCheckBox; - - QChartView *m_chartView; - QPieSeries *m_series; - CustomSlice *m_slice; - - QDoubleSpinBox *m_hPosition; - QDoubleSpinBox *m_vPosition; - QDoubleSpinBox *m_sizeFactor; - QDoubleSpinBox *m_startAngle; - QDoubleSpinBox *m_endAngle; - QDoubleSpinBox *m_holeSize; - - QLineEdit *m_sliceName; - QDoubleSpinBox *m_sliceValue; - QCheckBox *m_sliceLabelVisible; - QDoubleSpinBox *m_sliceLabelArmFactor; - QCheckBox *m_sliceExploded; - QDoubleSpinBox *m_sliceExplodedFactor; - QPushButton *m_brush; - BrushTool *m_brushTool; - QPushButton *m_pen; - PenTool *m_penTool; - QPushButton *m_font; - QPushButton *m_labelBrush; - QComboBox *m_labelPosition; - BrushTool *m_labelBrushTool; -}; - -#endif // MAINWIDGET_H diff --git a/demos/piechartcustomization/pentool.cpp b/demos/piechartcustomization/pentool.cpp deleted file mode 100644 index 104231ee..00000000 --- a/demos/piechartcustomization/pentool.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "pentool.h" -#include <QPushButton> -#include <QDoubleSpinBox> -#include <QComboBox> -#include <QFormLayout> -#include <QColorDialog> - -PenTool::PenTool(QString title, QWidget *parent) - : QWidget(parent) -{ - setWindowTitle(title); - setWindowFlags(Qt::Tool); - - m_colorButton = new QPushButton(); - - m_widthSpinBox = new QDoubleSpinBox(); - - m_styleCombo = new QComboBox(); - m_styleCombo->addItem("NoPen"); - m_styleCombo->addItem("SolidLine"); - m_styleCombo->addItem("DashLine"); - m_styleCombo->addItem("DotLine"); - m_styleCombo->addItem("DashDotLine"); - m_styleCombo->addItem("DashDotDotLine"); - - m_capStyleCombo = new QComboBox(); - m_capStyleCombo->addItem("FlatCap", Qt::FlatCap); - m_capStyleCombo->addItem("SquareCap", Qt::SquareCap); - m_capStyleCombo->addItem("RoundCap", Qt::RoundCap); - - m_joinStyleCombo = new QComboBox(); - m_joinStyleCombo->addItem("MiterJoin", Qt::MiterJoin); - m_joinStyleCombo->addItem("BevelJoin", Qt::BevelJoin); - m_joinStyleCombo->addItem("RoundJoin", Qt::RoundJoin); - m_joinStyleCombo->addItem("SvgMiterJoin", Qt::SvgMiterJoin); - - QFormLayout *layout = new QFormLayout(); - layout->addRow("Color", m_colorButton); - layout->addRow("Width", m_widthSpinBox); - layout->addRow("Style", m_styleCombo); - layout->addRow("Cap style", m_capStyleCombo); - layout->addRow("Join style", m_joinStyleCombo); - setLayout(layout); - - connect(m_colorButton, SIGNAL(clicked()), this, SLOT(showColorDialog())); - connect(m_widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateWidth(double))); - connect(m_styleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStyle(int))); - connect(m_capStyleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCapStyle(int))); - connect(m_joinStyleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateJoinStyle(int))); -} - -void PenTool::setPen(const QPen &pen) -{ - m_pen = pen; - m_colorButton->setText(m_pen.color().name()); - m_widthSpinBox->setValue(m_pen.widthF()); - m_styleCombo->setCurrentIndex(m_pen.style()); // index matches the enum - m_capStyleCombo->setCurrentIndex(m_capStyleCombo->findData(m_pen.capStyle())); - m_joinStyleCombo->setCurrentIndex(m_joinStyleCombo->findData(m_pen.joinStyle())); -} - -QPen PenTool::pen() const -{ - return m_pen; -} - -QString PenTool::name() -{ - return name(m_pen); -} - -QString PenTool::name(const QPen &pen) -{ - return pen.color().name() + ":" + QString::number(pen.widthF()); -} - -void PenTool::showColorDialog() -{ - QColorDialog dialog(m_pen.color()); - dialog.show(); - dialog.exec(); - m_pen.setColor(dialog.selectedColor()); - m_colorButton->setText(m_pen.color().name()); - emit changed(); -} - -void PenTool::updateWidth(double width) -{ - if (!qFuzzyCompare((qreal) width, m_pen.widthF())) { - m_pen.setWidthF(width); - emit changed(); - } -} - -void PenTool::updateStyle(int style) -{ - if (m_pen.style() != style) { - m_pen.setStyle((Qt::PenStyle) style); - emit changed(); - } -} - -void PenTool::updateCapStyle(int index) -{ - Qt::PenCapStyle capStyle = (Qt::PenCapStyle) m_capStyleCombo->itemData(index).toInt(); - if (m_pen.capStyle() != capStyle) { - m_pen.setCapStyle(capStyle); - emit changed(); - } -} - -void PenTool::updateJoinStyle(int index) -{ - Qt::PenJoinStyle joinStyle = (Qt::PenJoinStyle) m_joinStyleCombo->itemData(index).toInt(); - if (m_pen.joinStyle() != joinStyle) { - m_pen.setJoinStyle(joinStyle); - emit changed(); - } -} - -#include "moc_pentool.cpp" diff --git a/demos/piechartcustomization/pentool.h b/demos/piechartcustomization/pentool.h deleted file mode 100644 index 66e7ab10..00000000 --- a/demos/piechartcustomization/pentool.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 PENTOOL_H -#define PENTOOL_H - -#include <QWidget> -#include <QPen> - -class QPushButton; -class QDoubleSpinBox; -class QComboBox; - -class PenTool : public QWidget -{ - Q_OBJECT - -public: - explicit PenTool(QString title, QWidget *parent = 0); - void setPen(const QPen &pen); - QPen pen() const; - QString name(); - static QString name(const QPen &pen); - -Q_SIGNALS: - void changed(); - -public Q_SLOTS: - void showColorDialog(); - void updateWidth(double width); - void updateStyle(int style); - void updateCapStyle(int index); - void updateJoinStyle(int index); - -private: - QPen m_pen; - QPushButton *m_colorButton; - QDoubleSpinBox *m_widthSpinBox; - QComboBox *m_styleCombo; - QComboBox *m_capStyleCombo; - QComboBox *m_joinStyleCombo; -}; - -#endif // PENTOOL_H diff --git a/demos/piechartcustomization/piechartcustomization.pro b/demos/piechartcustomization/piechartcustomization.pro deleted file mode 100644 index 9698b487..00000000 --- a/demos/piechartcustomization/piechartcustomization.pro +++ /dev/null @@ -1,15 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} -TARGET = piechartcustomization -SOURCES += main.cpp \ - pentool.cpp \ - brushtool.cpp \ - customslice.cpp \ - mainwidget.cpp - -HEADERS += \ - pentool.h \ - brushtool.h \ - customslice.h \ - mainwidget.h diff --git a/demos/qmlaxes/main.cpp b/demos/qmlaxes/main.cpp deleted file mode 100644 index 9ce94bcc..00000000 --- a/demos/qmlaxes/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDir> -#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/qmlaxes/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlaxes/qml/qmlaxes/View1.qml b/demos/qmlaxes/qml/qmlaxes/View1.qml deleted file mode 100644 index 7ee15f61..00000000 --- a/demos/qmlaxes/qml/qmlaxes/View1.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Two Series, Common Axes" - anchors.fill: parent - legend.visible: false - - ValueAxis { - id: axisX - min: 0 - max: 10 - tickCount: 5 - } - - ValueAxis { - id: axisY - min: -0.5 - max: 1.5 - } - - LineSeries { - id: series1 - axisX: axisX - axisY: axisY - } - - ScatterSeries { - id: series2 - axisX: axisX - axisY: axisY - } - } - - // Add data dynamically to the series - Component.onCompleted: { - for (var i = 0; i <= 10; i++) { - series1.append(i, Math.random()); - series2.append(i, Math.random()); - } - } - //![1] -} diff --git a/demos/qmlaxes/qml/qmlaxes/View2.qml b/demos/qmlaxes/qml/qmlaxes/View2.qml deleted file mode 100644 index bba5aaa6..00000000 --- a/demos/qmlaxes/qml/qmlaxes/View2.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Accurate Historical Data" - anchors.fill: parent - legend.visible: false - - LineSeries { - axisX: DateTimeAxis { - format: "yyyy MMM" - tickCount: 5 - } - axisY: ValueAxis { - min: 0 - max: 150 - } - - // Please note that month in JavaScript months are zero based, so 2 means March - XYPoint { x: toMsecsSinceEpoch(new Date(1950, 2, 15)); y: 5 } - XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 50 } - XYPoint { x: toMsecsSinceEpoch(new Date(1987, 12, 31)); y: 102 } - XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 100 } - XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 2)); y: 110 } - } - } - - // DateTimeAxis is based on QDateTimes so we must convert our JavaScript dates to - // milliseconds since epoch to make them match the DateTimeAxis values - function toMsecsSinceEpoch(date) { - var msecs = date.getTime(); - return msecs; - } - //![1] -} diff --git a/demos/qmlaxes/qml/qmlaxes/View3.qml b/demos/qmlaxes/qml/qmlaxes/View3.qml deleted file mode 100644 index 2985fef7..00000000 --- a/demos/qmlaxes/qml/qmlaxes/View3.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Numerical Data for Dummies" - anchors.fill: parent - legend.visible: false - - LineSeries { - axisY: CategoryAxis { - min: 0 - max: 30 - CategoryRange { - label: "critical" - endValue: 2 - } - CategoryRange { - label: "low" - endValue: 4 - } - CategoryRange { - label: "normal" - endValue: 7 - } - CategoryRange { - label: "high" - endValue: 15 - } - CategoryRange { - label: "extremely high" - endValue: 30 - } - } - - XYPoint { x: 0; y: 4.3 } - XYPoint { x: 1; y: 4.1 } - XYPoint { x: 2; y: 4.7 } - XYPoint { x: 3; y: 3.9 } - XYPoint { x: 4; y: 5.2 } - } - } - //![1] -} diff --git a/demos/qmlaxes/qml/qmlaxes/loader.qml b/demos/qmlaxes/qml/qmlaxes/loader.qml deleted file mode 100644 index be6d47b3..00000000 --- a/demos/qmlaxes/qml/qmlaxes/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Item { - id: container - width: 440 - height: 340 - Component.onCompleted: { - var co = Qt.createComponent("main.qml") - if (co.status == Component.Ready) { - var o = co.createObject(container) - } else { - console.log(co.errorString()) - console.log("QtCommercial.Chart 1.1 not available") - console.log("Please use correct QML_IMPORT_PATH export") - } - } -} diff --git a/demos/qmlaxes/qml/qmlaxes/main.qml b/demos/qmlaxes/qml/qmlaxes/main.qml deleted file mode 100644 index 56f5e288..00000000 --- a/demos/qmlaxes/qml/qmlaxes/main.qml +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - width: parent.width - height: parent.height - property int viewNumber: 1 - property int viewCount: 3 - - Loader { - id: loader - anchors.fill: parent - source: "View" + viewNumber + ".qml"; - } - - Rectangle { - id: infoText - anchors.centerIn: parent - width: parent.width - height: 40 - color: "black" - Text { - color: "white" - anchors.centerIn: parent - text: "Use left and right arrow keys to navigate" - } - - Behavior on opacity { - NumberAnimation { duration: 400 } - } - } - - MouseArea { - focus: true - anchors.fill: parent - onClicked: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - nextView(); - } - } - Keys.onPressed: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - if (event.key == Qt.Key_Left) { - previousView(); - } else { - nextView(); - } - } - } - } - - function nextView() { - var i = viewNumber + 1; - if (i > viewCount) - viewNumber = 1; - else - viewNumber = i; - } - - function previousView() { - var i = viewNumber - 1; - if (i <= 0) - viewNumber = viewCount; - else - viewNumber = i; - } -} diff --git a/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlaxes/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlaxes/qmlaxes.pro b/demos/qmlaxes/qmlaxes.pro deleted file mode 100644 index 3e1a0954..00000000 --- a/demos/qmlaxes/qmlaxes.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlaxes/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) diff --git a/demos/qmlaxes/resources.qrc b/demos/qmlaxes/resources.qrc deleted file mode 100644 index 29e173d4..00000000 --- a/demos/qmlaxes/resources.qrc +++ /dev/null @@ -1,9 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlaxes/loader.qml</file> - <file>qml/qmlaxes/main.qml</file> - <file>qml/qmlaxes/View1.qml</file> - <file>qml/qmlaxes/View2.qml</file> - <file>qml/qmlaxes/View3.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlchart/main.cpp b/demos/qmlchart/main.cpp deleted file mode 100644 index dbf65620..00000000 --- a/demos/qmlchart/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDir> -#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/qmlchart/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlchart/qml/qmlchart/View1.qml b/demos/qmlchart/qml/qmlchart/View1.qml deleted file mode 100644 index c2409ec9..00000000 --- a/demos/qmlchart/qml/qmlchart/View1.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - property variant othersSlice: 0 - - //![1] - ChartView { - id: chart - title: "Top-5 car brand shares in Finland" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - PieSeries { - id: pieSeries - PieSlice { label: "Volkswagen"; value: 13.5 } - PieSlice { label: "Toyota"; value: 10.9 } - PieSlice { label: "Ford"; value: 8.6 } - PieSlice { label: "Skoda"; value: 8.2 } - PieSlice { label: "Volvo"; value: 6.8 } - } - } - - Component.onCompleted: { - // You can also manipulate slices dynamically - othersSlice = pieSeries.append("Others", 52.0); - pieSeries.find("Volkswagen").exploded = true; - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View10.qml b/demos/qmlchart/qml/qmlchart/View10.qml deleted file mode 100644 index 4fef2052..00000000 --- a/demos/qmlchart/qml/qmlchart/View10.qml +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Stacked Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - HorizontalStackedBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View11.qml b/demos/qmlchart/qml/qmlchart/View11.qml deleted file mode 100644 index 2799d3ea..00000000 --- a/demos/qmlchart/qml/qmlchart/View11.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Percent Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - HorizontalPercentBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} - diff --git a/demos/qmlchart/qml/qmlchart/View12.qml b/demos/qmlchart/qml/qmlchart/View12.qml deleted file mode 100644 index ce2d7373..00000000 --- a/demos/qmlchart/qml/qmlchart/View12.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - id: chart - title: "Production costs" - anchors.fill: parent - legend.visible: false - - PieSeries { - id: pieOuter - size: 0.96 - holeSize: 0.7 - PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" } - PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" } - PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" } - } - - PieSeries { - size: 0.7 - id: pieInner - holeSize: 0.25 - - PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" } - PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" } - PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" } - - PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" } - PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" } - PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" } - - PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" } - PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" } - PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" } - } - } - - Component.onCompleted: { - // Set the common slice properties dynamically for convenience - for (var i = 0; i < pieOuter.count; i++) { - pieOuter.at(i).labelPosition = PieSlice.LabelOutside; - pieOuter.at(i).labelVisible = true; - pieOuter.at(i).borderWidth = 3; - } - for (var i = 0; i < pieInner.count; i++) { - pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal; - pieInner.at(i).labelVisible = true; - pieInner.at(i).borderWidth = 2; - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View2.qml b/demos/qmlchart/qml/qmlchart/View2.qml deleted file mode 100644 index bc96abc7..00000000 --- a/demos/qmlchart/qml/qmlchart/View2.qml +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Line" - anchors.fill: parent - - LineSeries { - name: "LineSeries" - XYPoint { x: 0; y: 0 } - XYPoint { x: 1.1; y: 2.1 } - XYPoint { x: 1.9; y: 3.3 } - XYPoint { x: 2.1; y: 2.1 } - XYPoint { x: 2.9; y: 4.9 } - XYPoint { x: 3.4; y: 3.0 } - XYPoint { x: 4.1; y: 3.3 } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View3.qml b/demos/qmlchart/qml/qmlchart/View3.qml deleted file mode 100644 index 26ac57ce..00000000 --- a/demos/qmlchart/qml/qmlchart/View3.qml +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Spline" - anchors.fill: parent - - SplineSeries { - name: "SplineSeries" - XYPoint { x: 0; y: 0.0 } - XYPoint { x: 1.1; y: 3.2 } - XYPoint { x: 1.9; y: 2.4 } - XYPoint { x: 2.1; y: 2.1 } - XYPoint { x: 2.9; y: 2.6 } - XYPoint { x: 3.4; y: 2.3 } - XYPoint { x: 4.1; y: 3.1 } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View4.qml b/demos/qmlchart/qml/qmlchart/View4.qml deleted file mode 100644 index 32ccb19d..00000000 --- a/demos/qmlchart/qml/qmlchart/View4.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "NHL All-Star Team Players" - anchors.fill: parent - - ValueAxis { - id: valueAxis - min: 2000 - max: 2011 - tickCount: 12 - labelFormat: "%.0f" - } - - AreaSeries { - name: "Russian" - color: "#FFD52B1E" - borderColor: "#FF0039A5" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 1 } - XYPoint { x: 2001; y: 1 } - XYPoint { x: 2002; y: 1 } - XYPoint { x: 2003; y: 1 } - XYPoint { x: 2004; y: 1 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 1 } - XYPoint { x: 2007; y: 1 } - XYPoint { x: 2008; y: 4 } - XYPoint { x: 2009; y: 3 } - XYPoint { x: 2010; y: 2 } - XYPoint { x: 2011; y: 1 } - } - } - // ... - //![1] - - AreaSeries { - name: "Swedish" - color: "#AF005292" - borderColor: "#AFFDCA00" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 1 } - XYPoint { x: 2001; y: 1 } - XYPoint { x: 2002; y: 3 } - XYPoint { x: 2003; y: 3 } - XYPoint { x: 2004; y: 2 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 2 } - XYPoint { x: 2007; y: 1 } - XYPoint { x: 2008; y: 2 } - XYPoint { x: 2009; y: 1 } - XYPoint { x: 2010; y: 3 } - XYPoint { x: 2011; y: 3 } - } - } - - AreaSeries { - name: "Finnish" - color: "#00357F" - borderColor: "#FEFEFE" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 0 } - XYPoint { x: 2001; y: 0 } - XYPoint { x: 2002; y: 0 } - XYPoint { x: 2003; y: 0 } - XYPoint { x: 2004; y: 0 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 1 } - XYPoint { x: 2007; y: 0 } - XYPoint { x: 2008; y: 0 } - XYPoint { x: 2009; y: 0 } - XYPoint { x: 2010; y: 0 } - XYPoint { x: 2011; y: 1 } - } - } - } -} diff --git a/demos/qmlchart/qml/qmlchart/View5.qml b/demos/qmlchart/qml/qmlchart/View5.qml deleted file mode 100644 index 5632b6c4..00000000 --- a/demos/qmlchart/qml/qmlchart/View5.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Scatters" - anchors.fill: parent - - ScatterSeries { - id: scatter1 - name: "Scatter1" - XYPoint { x: 1.5; y: 1.5 } - XYPoint { x: 1.5; y: 1.6 } - XYPoint { x: 1.57; y: 1.55 } - XYPoint { x: 1.8; y: 1.8 } - XYPoint { x: 1.9; y: 1.6 } - XYPoint { x: 2.1; y: 1.3 } - XYPoint { x: 2.5; y: 2.1 } - } - - ScatterSeries { - name: "Scatter2" - // ... - //![1] - XYPoint { x: 2.0; y: 2.0 } - XYPoint { x: 2.0; y: 2.1 } - XYPoint { x: 2.07; y: 2.05 } - XYPoint { x: 2.2; y: 2.9 } - XYPoint { x: 2.4; y: 2.7 } - XYPoint { x: 2.67; y: 2.65 } - } - } -} diff --git a/demos/qmlchart/qml/qmlchart/View6.qml b/demos/qmlchart/qml/qmlchart/View6.qml deleted file mode 100644 index ff5b3e8b..00000000 --- a/demos/qmlchart/qml/qmlchart/View6.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - BarSeries { - id: mySeries - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View7.qml b/demos/qmlchart/qml/qmlchart/View7.qml deleted file mode 100644 index 6b86b2c6..00000000 --- a/demos/qmlchart/qml/qmlchart/View7.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Stacked Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - StackedBarSeries { - id: mySeries - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View8.qml b/demos/qmlchart/qml/qmlchart/View8.qml deleted file mode 100644 index eeb0147a..00000000 --- a/demos/qmlchart/qml/qmlchart/View8.qml +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Percent Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - PercentBarSeries { - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/qmlchart/qml/qmlchart/View9.qml b/demos/qmlchart/qml/qmlchart/View9.qml deleted file mode 100644 index 5df8d52f..00000000 --- a/demos/qmlchart/qml/qmlchart/View9.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - - HorizontalBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} - diff --git a/demos/qmlchart/qml/qmlchart/loader.qml b/demos/qmlchart/qml/qmlchart/loader.qml deleted file mode 100644 index 271f1f76..00000000 --- a/demos/qmlchart/qml/qmlchart/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Item { - id: container - width: 600 - height: 400 - Component.onCompleted: { - var co = Qt.createComponent("main.qml") - if (co.status == Component.Ready) { - var o = co.createObject(container) - } else { - console.log(co.errorString()) - console.log("QtCommercial.Chart 1.1 not available") - console.log("Please use correct QML_IMPORT_PATH export") - } - } -} diff --git a/demos/qmlchart/qml/qmlchart/main.qml b/demos/qmlchart/qml/qmlchart/main.qml deleted file mode 100644 index d4ca8f82..00000000 --- a/demos/qmlchart/qml/qmlchart/main.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - width: parent.width - height: parent.height - property int viewNumber: 1 - - Loader { - id: loader - anchors.fill: parent - source: "View" + viewNumber + ".qml"; - } - - Rectangle { - id: infoText - anchors.centerIn: parent - width: parent.width - height: 40 - color: "black" - Text { - color: "white" - anchors.centerIn: parent - text: "Use left and right arrow keys to navigate between chart types" - } - - Behavior on opacity { - NumberAnimation { duration: 400 } - } - } - - MouseArea { - focus: true - anchors.fill: parent - onClicked: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - nextView(); - } - } - Keys.onPressed: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - if (event.key == Qt.Key_Left) { - previousView(); - } else { - nextView(); - } - } - } - } - - function nextView() { - var i = viewNumber + 1; - if (i > 12) - viewNumber = 1; - else - viewNumber = i; - } - - function previousView() { - var i = viewNumber - 1; - if (i <= 0) - viewNumber = 12; - else - viewNumber = i; - } -} diff --git a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlchart/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlchart/qmlchart.pro b/demos/qmlchart/qmlchart.pro deleted file mode 100644 index f9996cb5..00000000 --- a/demos/qmlchart/qmlchart.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlchart/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) diff --git a/demos/qmlchart/qmlchart.svg b/demos/qmlchart/qmlchart.svg deleted file mode 100644 index 566acfad..00000000 --- a/demos/qmlchart/qmlchart.svg +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - height="44px" - version="1.1" - viewBox="0 0 44 44" - width="44px" - x="0px" - y="0px" - id="svg2" - inkscape:version="0.47 r22583" - sodipodi:docname="qt.svg"> - <metadata - id="metadata18"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs16"> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 22 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="44 : 22 : 1" - inkscape:persp3d-origin="22 : 14.666667 : 1" - id="perspective2836" /> - </defs> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1020" - id="namedview14" - showgrid="false" - inkscape:zoom="21.454545" - inkscape:cx="49.412871" - inkscape:cy="21.894358" - inkscape:window-x="-4" - inkscape:window-y="-4" - inkscape:window-maximized="1" - inkscape:current-layer="g3" /> - <g - transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)" - id="g3"> - <path - d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z" - style="fill:#006225" - id="path5" - sodipodi:nodetypes="cccccccc" /> - <path - d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z" - style="fill:#80c342" - id="path7" /> - <path - d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z" - style="fill:#006225" - id="path11" /> - <path - d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z" - style="fill:#006225" - id="path13" /> - <path - id="path17" - style="fill:#ffffff" - d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" /> - <path - d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z" - style="fill:#006225" - id="path19" /> - <path - id="path21" - style="fill:#006225" - d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" /> - </g> -</svg> diff --git a/demos/qmlchart/resources.qrc b/demos/qmlchart/resources.qrc deleted file mode 100644 index 43b6f8a8..00000000 --- a/demos/qmlchart/resources.qrc +++ /dev/null @@ -1,18 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlchart/loader.qml</file> - <file>qml/qmlchart/main.qml</file> - <file>qml/qmlchart/View1.qml</file> - <file>qml/qmlchart/View2.qml</file> - <file>qml/qmlchart/View3.qml</file> - <file>qml/qmlchart/View4.qml</file> - <file>qml/qmlchart/View5.qml</file> - <file>qml/qmlchart/View6.qml</file> - <file>qml/qmlchart/View7.qml</file> - <file>qml/qmlchart/View8.qml</file> - <file>qml/qmlchart/View9.qml</file> - <file>qml/qmlchart/View10.qml</file> - <file>qml/qmlchart/View11.qml</file> - <file>qml/qmlchart/View12.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlcustomizations/main.cpp b/demos/qmlcustomizations/main.cpp deleted file mode 100644 index 79424b95..00000000 --- a/demos/qmlcustomizations/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDir> -#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/qmlcustomizations/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml b/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml deleted file mode 100644 index c3eea330..00000000 --- a/demos/qmlcustomizations/qml/qmlcustomizations/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Item { - id: container - width: 400 - height: 300 - Component.onCompleted: { - var co = Qt.createComponent("main.qml") - if (co.status == Component.Ready) { - var o = co.createObject(container) - } else { - console.log(co.errorString()) - console.log("QtCommercial.Chart 1.1 not available") - console.log("Please use correct QML_IMPORT_PATH export") - } - } -} diff --git a/demos/qmlcustomizations/qml/qmlcustomizations/main.qml b/demos/qmlcustomizations/qml/qmlcustomizations/main.qml deleted file mode 100644 index f338d692..00000000 --- a/demos/qmlcustomizations/qml/qmlcustomizations/main.qml +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -Rectangle { - width: parent.width - height: parent.height - property int __activeIndex: 1 - property real __intervalCoefficient: 0 - - //![1] - ChartView { - id: chartView - anchors.fill: parent - title: "Wheel of fortune" - legend.visible: false - - PieSeries { - id: wheelOfFortune - horizontalPosition: 0.3 - } - - SplineSeries { - id: splineSeries - } - - ScatterSeries { - id: scatterSeries - } - } - //![1] - - //![2] - Component.onCompleted: { - __intervalCoefficient = Math.random() + 0.1; - - for (var i = 0; i < 20; i++) - wheelOfFortune.append("", 1); - - var interval = 1; - for (var j = 0; interval < 800; j++) { - interval = __intervalCoefficient * j * j; - splineSeries.append(j, interval); - } - chartView.axisX(scatterSeries).max = j; - chartView.axisY(scatterSeries).max = 1000; - } - //![2] - - Timer { - triggeredOnStart: true - running: true - repeat: true - interval: 100 - onTriggered: { - var index = __activeIndex % wheelOfFortune.count; - if (interval < 700) { - //![3] - wheelOfFortune.at(index).exploded = false; - __activeIndex++; - index = __activeIndex % wheelOfFortune.count; - wheelOfFortune.at(index).exploded = true; - //![3] - interval = splineSeries.at(__activeIndex).y; - //![4] - scatterSeries.clear(); - scatterSeries.append(__activeIndex, interval); - scatterSeries.color = Qt.tint(scatterSeries.color, "#05FF0000"); - scatterSeries.markerSize += 0.5; - //![4] - } else { - //![5] - // Switch the colors of the slice and the border - wheelOfFortune.at(index).borderWidth = 2; - var borderColor = wheelOfFortune.at(index).borderColor; - wheelOfFortune.at(index).borderColor = wheelOfFortune.at(index).color; - wheelOfFortune.at(index).color = borderColor; - //![5] - } - } - } -} diff --git a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlcustomizations/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlcustomizations/qmlcustomizations.pro b/demos/qmlcustomizations/qmlcustomizations.pro deleted file mode 100644 index f4da8598..00000000 --- a/demos/qmlcustomizations/qmlcustomizations.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlcustomizations/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) diff --git a/demos/qmlcustomizations/resources.qrc b/demos/qmlcustomizations/resources.qrc deleted file mode 100644 index d7966f36..00000000 --- a/demos/qmlcustomizations/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlcustomizations/loader.qml</file> - <file>qml/qmlcustomizations/main.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlcustomlegend/main.cpp b/demos/qmlcustomlegend/main.cpp deleted file mode 100644 index 774b3ffc..00000000 --- a/demos/qmlcustomlegend/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDir> -#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/qmlcustomlegend/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml deleted file mode 100755 index 8173b5d6..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/AnimatedAreaSeries.qml +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.1
-
-AreaSeries {
- id: series
-
- Behavior on opacity {
- NumberAnimation { duration: 250 }
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml deleted file mode 100755 index c0b66672..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewHighlighted.qml +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.2
-
-//![1]
-ChartView {
- id: chartViewHighlighted
- title: ""
- property variant selectedSeries
- signal clicked
- legend.visible: false
- margins.top: 10
- margins.bottom: 0
-
- LineSeries {
- id: lineSeries
-
- axisX: ValueAxis {
- min: 2006
- max: 2012
- labelFormat: "%.0f"
- tickCount: 7
- }
- axisY: ValueAxis {
- id: axisY
- titleText: "EUR"
- min: 0
- max: 40000
- niceNumbersEnabled: true
- labelFormat: "%.0f"
- tickCount: 5
- }
- }
-//![1]
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- chartViewHighlighted.clicked();
- }
- }
-
- onSelectedSeriesChanged: {
- lineSeries.clear();
- lineSeries.color = selectedSeries.color;
- var maxVal = 0.0;
- for (var i = 0; i < selectedSeries.upperSeries.count; i++ ) {
- var y = selectedSeries.upperSeries.at(i).y - selectedSeries.lowerSeries.at(i).y;
- lineSeries.append(selectedSeries.upperSeries.at(i).x, y);
- if (maxVal < y)
- maxVal = y;
- }
- chartViewHighlighted.title = selectedSeries.name;
- axisY.max = maxVal;
- }
-}
-
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml deleted file mode 100755 index 60680934..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewSelector.qml +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.1
-
-Rectangle {
- id: chartViewSelector
- width: parent.width
- height: parent.height
- signal seriesAdded(string seriesName, color seriesColor)
-
- function highlightSeries(seriesName) {
- if (seriesName == "") {
- if (state != "")
- state = "";
-
- for (var i = 0; i < chartViewStacked.count; i++)
- chartViewStacked.series(i).opacity = 1.0;
- } else {
- var targetOpacity = 0.1;
- for (var j = 0; j < chartViewStacked.count; j++) {
- if (chartViewStacked.series(j).name != seriesName)
- chartViewStacked.series(j).opacity = 0.25;
- else if (state == "highlight")
- chartViewSelected.selectedSeries = chartViewStacked.series(j);
- }
- }
- }
-
- function selectSeries(seriesName) {
- for (var i = 0; i < chartViewStacked.count; i++) {
- if (chartViewStacked.series(i).name == seriesName) {
- chartViewSelected.selectedSeries = chartViewStacked.series(i);
- if (chartViewSelector.state == "")
- chartViewSelector.state = "highlighted";
- else
- chartViewSelector.state = "";
- }
- }
- }
-
- ChartViewStacked {
- id: chartViewStacked
- anchors.left: parent.left
- anchors.leftMargin: 0
- width: parent.width
- height: parent.height
- onSeriesAdded: chartViewSelector.seriesAdded(series.name, series.color);
- }
-
- ChartViewHighlighted {
- id: chartViewSelected
- anchors.left: chartViewStacked.right
- width: parent.width
- height: parent.height
-
- opacity: 0.0
- onClicked: {
- chartViewSelector.state = "";
- }
- }
-
- states: State {
- name: "highlighted"
- PropertyChanges {
- target: chartViewSelected
- opacity: 1.0
- }
- PropertyChanges {
- target: chartViewStacked
- anchors.leftMargin: -chartViewStacked.width
- opacity: 0.0
- }
- }
-
- transitions: Transition {
- PropertyAnimation {
- properties: "width, height, opacity, anchors.leftMargin"
- duration: 400
- }
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml deleted file mode 100755 index 365da46a..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/ChartViewStacked.qml +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.2
-
-ChartView {
- id: chartView
- title: "Government Taxes"
- legend.visible: false
- signal entered(string seriesName)
- signal exited(string seriesName)
- margins.top: 10
- margins.bottom: 0
-
- ValueAxis {
- id: axisX
- min: 2006
- max: 2012
- tickCount: 7
- labelFormat: "%.0f"
- }
-
- ValueAxis {
- id: axisY
- titleText: "EUR"
- min: 0
- max: 90000
- tickCount: 10
- labelFormat: "%.0f"
- }
-
- AnimatedAreaSeries {
- id: stateSeries
- name: "state"
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: stateUpper
- XYPoint { x: 2006; y: 33119 }
- XYPoint { x: 2007; y: 37941 }
- XYPoint { x: 2008; y: 40122 }
- XYPoint { x: 2009; y: 38991 }
- XYPoint { x: 2010; y: 34055 }
- XYPoint { x: 2011; y: 34555 }
- XYPoint { x: 2012; y: 38991 }
- }
- lowerSeries: LineSeries {
- XYPoint { x: 2006; y: 0 }
- XYPoint { x: 2007; y: 0 }
- XYPoint { x: 2008; y: 0 }
- XYPoint { x: 2009; y: 0 }
- XYPoint { x: 2010; y: 0 }
- XYPoint { x: 2011; y: 0 }
- XYPoint { x: 2012; y: 0 }
- }
- }
-
- //![1]
- AnimatedAreaSeries {
- id: municipalSeries
- name: "municipal"
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: municipalUpper
- XYPoint { x: 2006; y: 33119 + 13443 }
- XYPoint { x: 2007; y: 37941 + 15311 }
- XYPoint { x: 2008; y: 40122 + 16552 }
- XYPoint { x: 2009; y: 38991 + 17904 }
- XYPoint { x: 2010; y: 34055 + 17599 }
- XYPoint { x: 2011; y: 34555 + 19002 }
- XYPoint { x: 2012; y: 38991 + 19177 }
- }
- lowerSeries: stateUpper
- }
- //![1]
-
- AnimatedAreaSeries {
- id: socialSeries
- name: "social sec."
- axisX: axisX
- axisY: axisY
- borderWidth: 0
- upperSeries: LineSeries {
- id: socialUpper
- XYPoint { x: 2006; y: 33119 + 13443 + 18855 }
- XYPoint { x: 2007; y: 37941 + 15311 + 20238 }
- XYPoint { x: 2008; y: 40122 + 16552 + 21347 }
- XYPoint { x: 2009; y: 38991 + 17904 + 22376 }
- XYPoint { x: 2010; y: 34055 + 17599 + 22076 }
- XYPoint { x: 2011; y: 34555 + 19002 + 22631 }
- XYPoint { x: 2012; y: 38991 + 19177 + 23686 }
- }
- lowerSeries: municipalUpper
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml deleted file mode 100755 index 578eed26..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/CustomLegend.qml +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.1
-
-Rectangle {
- id: legend
- color: "lightgray"
- property int seriesCount: 0
- property variant seriesNames: []
- property variant seriesColors: []
- signal entered(string seriesName)
- signal exited(string seriesName)
- signal selected(string seriesName)
-
- function addSeries(seriesName, color) {
- var names = seriesNames;
- names[seriesCount] = seriesName;
- seriesNames = names;
-
- var colors = seriesColors;
- colors[seriesCount] = color;
- seriesColors = colors;
-
- seriesCount++;
- }
-
- Gradient {
- id: buttonGradient
- GradientStop { position: 0.0; color: "#F0F0F0" }
- GradientStop { position: 1.0; color: "#A0A0A0" }
- }
-
- Gradient {
- id: buttonGradientHovered
- GradientStop { position: 0.0; color: "#FFFFFF" }
- GradientStop { position: 1.0; color: "#B0B0B0" }
- }
-
- //![2]
- Component {
- id: legendDelegate
- Rectangle {
- id: rect
- // ...
- //![2]
- property string name: seriesNames[index]
- property color markerColor: seriesColors[index]
- gradient: buttonGradient
- border.color: "#A0A0A0"
- border.width: 1
- radius: 4
- height: 20
- width: 100
-
- Row {
- id: row
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 5
- Rectangle {
- id: marker
- anchors.verticalCenter: parent.verticalCenter
- color: markerColor
- opacity: 0.3
- radius: 4
- width: 12
- height: 10
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- anchors.verticalCenterOffset: -1
- text: name
- }
- }
-
- //![3]
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- onEntered: {
- rect.gradient = buttonGradientHovered;
- legend.entered(label.text);
- }
- onExited: {
- rect.gradient = buttonGradient;
- legend.exited(label.text);
- marker.opacity = 0.3;
- marker.height = 10;
- }
- onClicked: {
- legend.selected(label.text);
- marker.opacity = 1.0;
- marker.height = 12;
- }
- }
- //![3]
- }
- }
-
- //![1]
- Row {
- id: legendRow
- anchors.centerIn: parent
- spacing: 6
-
- Repeater {
- id: legendRepeater
- model: seriesCount
- delegate: legendDelegate
- }
- }
- //![1]
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/loader.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/loader.qml deleted file mode 100755 index 1b09580d..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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
-
-Item {
- id: container
- width: 400
- height: 320
- Component.onCompleted: {
- var co = Qt.createComponent("main.qml")
- if (co.status == Component.Ready) {
- var o = co.createObject(container)
- } else {
- console.log(co.errorString())
- console.log("QtCommercial.Chart 1.1 not available")
- console.log("Please use correct QML_IMPORT_PATH export")
- }
- }
-}
diff --git a/demos/qmlcustomlegend/qml/qmlcustomlegend/main.qml b/demos/qmlcustomlegend/qml/qmlcustomlegend/main.qml deleted file mode 100755 index 1e91b10b..00000000 --- a/demos/qmlcustomlegend/qml/qmlcustomlegend/main.qml +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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.1
-
-Rectangle {
- id: main
- width: parent.width
- height: parent.height
-
- Column {
- id: column
- anchors.fill: parent
- anchors.bottomMargin: 10
- spacing: 0
-
- ChartViewSelector {
- id: chartViewSelector
- width: parent.width
- height: parent.height - customLegend.height - anchors.bottomMargin
- onSeriesAdded: customLegend.addSeries(seriesName, seriesColor);
- }
-
- CustomLegend {
- id: customLegend
- width: parent.width
- height: 35
- anchors.horizontalCenter: parent.horizontalCenter
- onEntered: chartViewSelector.highlightSeries(seriesName);
- onExited: chartViewSelector.highlightSeries("");
- onSelected: chartViewSelector.selectSeries(seriesName);
- }
- }
-
- states: State {
- name: "highlighted"
- PropertyChanges {
- target: chartViewHighlighted
- width: column.width
- height: (column.height - column.anchors.margins * 2 - customLegend.height)
- }
- PropertyChanges {
- target: chartViewStacked
- width: 1
- height: 1
- }
- }
-}
diff --git a/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlcustomlegend/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlcustomlegend/qmlcustomlegend.pro b/demos/qmlcustomlegend/qmlcustomlegend.pro deleted file mode 100755 index fc376490..00000000 --- a/demos/qmlcustomlegend/qmlcustomlegend.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) {
- error( "Couldn't find the demos.pri file!" )
-}
-
-RESOURCES += resources.qrc
-SOURCES += main.cpp
-OTHER_FILES += qml/qmlcustomlegend/*
-
-include(qmlapplicationviewer/qmlapplicationviewer.pri)
diff --git a/demos/qmlcustomlegend/resources.qrc b/demos/qmlcustomlegend/resources.qrc deleted file mode 100755 index 5c3ad444..00000000 --- a/demos/qmlcustomlegend/resources.qrc +++ /dev/null @@ -1,11 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlcustomlegend/loader.qml</file> - <file>qml/qmlcustomlegend/main.qml</file> - <file>qml/qmlcustomlegend/CustomLegend.qml</file> - <file>qml/qmlcustomlegend/ChartViewStacked.qml</file> - <file>qml/qmlcustomlegend/ChartViewHighlighted.qml</file> - <file>qml/qmlcustomlegend/ChartViewSelector.qml</file> - <file>qml/qmlcustomlegend/AnimatedAreaSeries.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlf1legends/main.cpp b/demos/qmlf1legends/main.cpp deleted file mode 100644 index 7138ce8e..00000000 --- a/demos/qmlf1legends/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDebug> -#include <QDir> -#include "qmlapplicationviewer.h" - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QScopedPointer<QApplication> app(createApplication(argc, argv)); - - QmlApplicationViewer viewer; -#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/qmlf1legends/main.qml")); - viewer.setRenderHint(QPainter::Antialiasing, true); - viewer.showExpanded(); - return app->exec(); -} diff --git a/demos/qmlf1legends/qml/qmlf1legends/SpeedsXml.qml b/demos/qmlf1legends/qml/qmlf1legends/SpeedsXml.qml deleted file mode 100644 index 6fb05dad..00000000 --- a/demos/qmlf1legends/qml/qmlf1legends/SpeedsXml.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 - -//![1] -XmlListModel { - // Hard-coded test data - xml: "<results><row><speedTrap>0</speedTrap><driver>Fittipaldi</driver><speed>104.12</speed></row>" - +"<row><speedTrap>0</speedTrap><driver>Stewart</driver><speed>106.12</speed></row>" - +"<row><speedTrap>0</speedTrap><driver>Hunt</driver><speed>106.12</speed></row>" - // ... -//![1] - +"<row><speedTrap>1</speedTrap><driver>Fittipaldi</driver><speed>115.12</speed></row>" - +"<row><speedTrap>1</speedTrap><driver>Stewart</driver><speed>114.12</speed></row>" - +"<row><speedTrap>1</speedTrap><driver>Hunt</driver><speed>115.12</speed></row>" - +"<row><speedTrap>2</speedTrap><driver>Hunt</driver><speed>165.23</speed></row>" - +"<row><speedTrap>2</speedTrap><driver>Fittipaldi</driver><speed>175.23</speed></row>" - +"<row><speedTrap>2</speedTrap><driver>Stewart</driver><speed>168.23</speed></row>" - +"<row><speedTrap>3</speedTrap><driver>Hunt</driver><speed>104.87</speed></row>" - +"<row><speedTrap>3</speedTrap><driver>Fittipaldi</driver><speed>104.43</speed></row>" - +"<row><speedTrap>3</speedTrap><driver>Stewart</driver><speed>94.83</speed></row>" - +"<row><speedTrap>4</speedTrap><driver>Hunt</driver><speed>107.87</speed></row>" - +"<row><speedTrap>4</speedTrap><driver>Fittipaldi</driver><speed>111.84</speed></row>" - +"<row><speedTrap>4</speedTrap><driver>Stewart</driver><speed>106.84</speed></row>" - +"<row><speedTrap>5</speedTrap><driver>Hunt</driver><speed>94.87</speed></row>" - +"<row><speedTrap>5</speedTrap><driver>Stewart</driver><speed>92.37</speed></row>" - +"<row><speedTrap>5</speedTrap><driver>Fittipaldi</driver><speed>99.37</speed></row>" - +"<row><speedTrap>6</speedTrap><driver>Hunt</driver><speed>52.87</speed></row>" - +"<row><speedTrap>6</speedTrap><driver>Fittipaldi</driver><speed>42.87</speed></row>" - +"<row><speedTrap>6</speedTrap><driver>Stewart</driver><speed>55.87</speed></row>" - +"<row><speedTrap>7</speedTrap><driver>Hunt</driver><speed>77.87</speed></row>" - +"<row><speedTrap>7</speedTrap><driver>Fittipaldi</driver><speed>72.87</speed></row>" - +"<row><speedTrap>7</speedTrap><driver>Stewart</driver><speed>87.87</speed></row>" - +"<row><speedTrap>8</speedTrap><driver>Hunt</driver><speed>94.17</speed></row>" - +"<row><speedTrap>8</speedTrap><driver>Fittipaldi</driver><speed>98.17</speed></row>" - +"<row><speedTrap>8</speedTrap><driver>Stewart</driver><speed>84.17</speed></row>" - +"<row><speedTrap>9</speedTrap><driver>Hunt</driver><speed>91.87</speed></row>" - +"<row><speedTrap>9</speedTrap><driver>Fittipaldi</driver><speed>71.87</speed></row>" - +"<row><speedTrap>9</speedTrap><driver>Stewart</driver><speed>81.87</speed></row>" - +"<row><speedTrap>10</speedTrap><driver>Hunt</driver><speed>104.87</speed></row>" - +"<row><speedTrap>10</speedTrap><driver>Fittipaldi</driver><speed>115.87</speed></row>" - +"<row><speedTrap>10</speedTrap><driver>Stewart</driver><speed>119.87</speed></row>" - +"<row><speedTrap>11</speedTrap><driver>Hunt</driver><speed>162.87</speed></row>" - +"<row><speedTrap>11</speedTrap><driver>Fittipaldi</driver><speed>155.84</speed></row>" - +"<row><speedTrap>11</speedTrap><driver>Stewart</driver><speed>152.84</speed></row>" - +"<row><speedTrap>12</speedTrap><driver>Hunt</driver><speed>181.87</speed></row>" - +"<row><speedTrap>12</speedTrap><driver>Fittipaldi</driver><speed>161.85</speed></row>" - +"<row><speedTrap>12</speedTrap><driver>Stewart</driver><speed>167.85</speed></row>" - +"<row><speedTrap>13</speedTrap><driver>Hunt</driver><speed>155.87</speed></row>" - +"<row><speedTrap>13</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row>" - +"<row><speedTrap>13</speedTrap><driver>Stewart</driver><speed>164.87</speed></row>" - +"<row><speedTrap>14</speedTrap><driver>Hunt</driver><speed>197.57</speed></row>" - +"<row><speedTrap>14</speedTrap><driver>Fittipaldi</driver><speed>187.54</speed></row>" - +"<row><speedTrap>14</speedTrap><driver>Stewart</driver><speed>180.54</speed></row>" - +"<row><speedTrap>15</speedTrap><driver>Fittipaldi</driver><speed>216.87</speed></row>" - +"<row><speedTrap>15</speedTrap><driver>Hunt</driver><speed>207.87</speed></row>" - +"<row><speedTrap>15</speedTrap><driver>Stewart</driver><speed>197.87</speed></row>" - +"<row><speedTrap>16</speedTrap><driver>Hunt</driver><speed>82.87</speed></row>" - +"<row><speedTrap>16</speedTrap><driver>Fittipaldi</driver><speed>79.37</speed></row>" - +"<row><speedTrap>16</speedTrap><driver>Stewart</driver><speed>85.37</speed></row>" - +"<row><speedTrap>17</speedTrap><driver>Hunt</driver><speed>153.87</speed></row>" - +"<row><speedTrap>17</speedTrap><driver>Fittipaldi</driver><speed>143.87</speed></row>" - +"<row><speedTrap>17</speedTrap><driver>Stewart</driver><speed>133.87</speed></row>" - +"<row><speedTrap>18</speedTrap><driver>Hunt</driver><speed>89.87</speed></row>" - +"<row><speedTrap>18</speedTrap><driver>Fittipaldi</driver><speed>95.85</speed></row>" - +"<row><speedTrap>18</speedTrap><driver>Stewart</driver><speed>98.85</speed></row>" - +"<row><speedTrap>19</speedTrap><driver>Hunt</driver><speed>169.87</speed></row>" - +"<row><speedTrap>19</speedTrap><driver>Stewart</driver><speed>167.87</speed></row>" - +"<row><speedTrap>19</speedTrap><driver>Fittipaldi</driver><speed>154.87</speed></row>" - +"</results>" -//![2] - query: "/results/row" - - XmlRole { name: "speedTrap"; query: "speedTrap/string()" } - XmlRole { name: "driver"; query: "driver/string()" } - XmlRole { name: "speed"; query: "speed/string()" } -} -//![2] diff --git a/demos/qmlf1legends/qml/qmlf1legends/main.qml b/demos/qmlf1legends/qml/qmlf1legends/main.qml deleted file mode 100644 index 0f6ac73c..00000000 --- a/demos/qmlf1legends/qml/qmlf1legends/main.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 -import QtCommercial.Chart 1.1 - -Rectangle { - width: 400 - height: 300 - property int currentIndex: -1 - - //![1] - ChartView { - id: chartView - title: "Driver Speeds, lap 1" - anchors.fill: parent - legend.alignment: Qt.AlignTop - animationOptions: ChartView.SeriesAnimations - } - //![1] - - //![2] - // An example XmlListModel containing F1 legend drivers' speeds at speed traps - SpeedsXml { - id: speedsXml - onStatusChanged: { - if (status == XmlListModel.Ready) { - timer.start(); - } - } - } - //![2] - - //![3] - // A timer to mimic refreshing the data dynamically - Timer { - id: timer - interval: 700 - repeat: true - triggeredOnStart: true - running: false - onTriggered: { - currentIndex++; - if (currentIndex < speedsXml.count) { - // Check if there is a series for the data already (we are using driver name to identify series) - var lineSeries = chartView.series(speedsXml.get(currentIndex).driver); - if (!lineSeries) { - lineSeries = chartView.createSeries(ChartView.SeriesTypeLine, speedsXml.get(currentIndex).driver); - chartView.axisY().min = 0; - chartView.axisY().max = 250; - chartView.axisY().tickCount = 6; - chartView.axisY().titleText = "speed (kph)"; - chartView.axisX().titleText = "speed trap"; - chartView.axisX().labelFormat = "%.0f"; - } - lineSeries.append(speedsXml.get(currentIndex).speedTrap, speedsXml.get(currentIndex).speed); - - if (speedsXml.get(currentIndex).speedTrap > 3) { - chartView.axisX().max = Number(speedsXml.get(currentIndex).speedTrap) + 1; - chartView.axisX().min = chartView.axisX().max - 5; - } else { - chartView.axisX().max = 5; - chartView.axisX().min = 0; - } - chartView.axisX().tickCount = chartView.axisX().max - chartView.axisX().min + 1; - } else { - // No more data, change x-axis range to show all the data - timer.stop(); - chartView.animationOptions = ChartView.AllAnimations; - chartView.axisX().min = 0; - chartView.axisX().max = speedsXml.get(currentIndex - 1).speedTrap; - } - } - } - //![3] -} diff --git a/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlf1legends/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlf1legends/qmlf1legends.pro b/demos/qmlf1legends/qmlf1legends.pro deleted file mode 100644 index 6e18e3e4..00000000 --- a/demos/qmlf1legends/qmlf1legends.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlf1legends/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) diff --git a/demos/qmlf1legends/resources.qrc b/demos/qmlf1legends/resources.qrc deleted file mode 100644 index 2a89c915..00000000 --- a/demos/qmlf1legends/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlf1legends/main.qml</file> - <file>qml/qmlf1legends/SpeedsXml.qml</file> - </qresource> -</RCC> diff --git a/demos/qmloscilloscope/datasource.cpp b/demos/qmloscilloscope/datasource.cpp deleted file mode 100644 index 35285778..00000000 --- a/demos/qmloscilloscope/datasource.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "datasource.h" -#include <QXYSeries> -#include <QAreaSeries> -#include <QDeclarativeView> -#include <QDebug> -#include <qmath.h> - -QTCOMMERCIALCHART_USE_NAMESPACE - -Q_DECLARE_METATYPE(QAbstractSeries *) -Q_DECLARE_METATYPE(QAbstractAxis *) - -DataSource::DataSource(QDeclarativeView *appViewer, QObject *parent) : - QObject(parent), - m_appViewer(appViewer), - m_index(-1) -{ - qRegisterMetaType<QAbstractSeries*>(); - qRegisterMetaType<QAbstractAxis*>(); - - generateData(0, 5, 1024); -} - -void DataSource::update(QAbstractSeries *series) -{ - if (series) { - QXYSeries *xySeries = static_cast<QXYSeries *>(series); - m_index++; - if (m_index > m_data.count() - 1) - m_index = 0; - - QList<QPointF> points = m_data.at(m_index); - // Use replace instead of clear + append, it's optimized for performance - xySeries->replace(points); - } -} - -void DataSource::generateData(int type, int rowCount, int colCount) -{ - // Remove previous data - foreach (QList<QPointF> row, m_data) - row.clear(); - m_data.clear(); - - // Append the new data depending on the type - for (int i(0); i < rowCount; i++) { - QList<QPointF> points; - for (int j(0); j < colCount; j++) { - qreal x(0); - qreal y(0); - switch (type) { - case 0: - // data with sin + random component - y = qSin(3.14159265358979 / 50 * j) + 0.5 + (qreal) rand() / (qreal) RAND_MAX; - x = j; - break; - case 1: - // linear data - x = j; - y = (qreal) i / 10; - break; - default: - // unknown, do nothing - break; - } - points.append(QPointF(x, y)); - } - m_data.append(points); - } -} - -void DataSource::setAntialiasing(bool enabled) -{ - m_appViewer->setRenderHint(QPainter::Antialiasing, enabled); -} diff --git a/demos/qmloscilloscope/datasource.h b/demos/qmloscilloscope/datasource.h deleted file mode 100644 index 7e9f476e..00000000 --- a/demos/qmloscilloscope/datasource.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 DATASOURCE_H -#define DATASOURCE_H - -#include <QObject> -#include <QAbstractSeries> - -class QDeclarativeView; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class DataSource : public QObject -{ - Q_OBJECT -public: - explicit DataSource(QDeclarativeView *appViewer, QObject *parent = 0); - -signals: - -public slots: - void generateData(int type, int rowCount, int colCount); - void update(QAbstractSeries *series); - void setAntialiasing(bool enabled); - -private: - QDeclarativeView *m_appViewer; - QList<QList<QPointF> > m_data; - int m_index; -}; - -#endif // DATASOURCE_H diff --git a/demos/qmloscilloscope/main.cpp b/demos/qmloscilloscope/main.cpp deleted file mode 100644 index c00f4599..00000000 --- a/demos/qmloscilloscope/main.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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/QDeclarativeContext> -#include <QtDeclarative/QDeclarativeEngine> -#include <QDir> -#include "qmlapplicationviewer.h" -#include "datasource.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 - - DataSource dataSource(viewer.data()); - viewer->rootContext()->setContextProperty("dataSource", &dataSource); - - // // viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer->setSource(QUrl("qrc:/qml/qmloscilloscope/main.qml")); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml b/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml deleted file mode 100644 index 8c590de6..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Column { - spacing: 8 - signal animationsEnabled(bool enabled) - signal seriesTypeChanged(string type) - signal refreshRateChanged(variant rate); - signal signalSourceChanged(string source, int signalCount, int sampleCount); - signal antialiasingEnabled(bool enabled) - - Text { - text: "Scope" - font.pointSize: 18 - color: "white" - } - - MultiButton { - text: "Graph: " - items: ["line", "spline", "scatter"] - currentSelection: 0 - onSelectionChanged: seriesTypeChanged(items[currentSelection]); - } - - MultiButton { - id: signalSourceButton - text: "Source: " - items: ["sin", "linear"] - currentSelection: 0 - onSelectionChanged: signalSourceChanged( - selection, - 5, - sampleCountButton.items[sampleCountButton.currentSelection]); - } - - MultiButton { - id: sampleCountButton - text: "Samples: " - items: [6, 128, 1024, 10000] - currentSelection: 2 - onSelectionChanged: signalSourceChanged( - signalSourceButton.items[signalSourceButton.currentSelection], - 5, - selection); - } - - MultiButton { - text: "Refresh rate: " - items: [1, 24, 60, 100] - currentSelection: 2 - onSelectionChanged: refreshRateChanged(items[currentSelection]); - } - - MultiButton { - text: "Animations: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: animationsEnabled(currentSelection == 1); - } - - MultiButton { - text: "Antialias: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: antialiasingEnabled(currentSelection == 1); - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml b/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml deleted file mode 100644 index 74f8577f..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - id: button - width: 115 - height: 31 - gradient: Gradient { - GradientStop { position: mouseArea.pressed ? 1.0 : 0.0; color: "#A09090" } - GradientStop { position: mouseArea.pressed ? 0.0 : 1.0; color: "#505050" } - } - smooth: true - - radius: 7 - property string text: "Option: " - property variant items: ["first"] - property int currentSelection: 0 - signal selectionChanged(variant selection) - - Text { - id: buttonText - anchors.centerIn: parent - color: "#FFFFFF" - text: button.text + button.items[currentSelection] - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - currentSelection = (currentSelection + 1) % items.length; - selectionChanged(button.items[currentSelection]); - } - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml b/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml deleted file mode 100644 index f6b249bb..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.2 - -//![1] -ChartView { - id: chartView - animationOptions: ChartView.NoAnimation - theme: ChartView.ChartThemeDark - - ValueAxis { - id: axisY1 - min: -1 - max: 4 - } - - ValueAxis { - id: axisY2 - min: -10 - max: 5 - } - - ValueAxis { - id: axisX - min: 0 - max: 1000 - } - - LineSeries { - id: lineSeries1 - name: "signal 1" - axisX: axisX - axisY: axisY1 - } - LineSeries { - id: lineSeries2 - name: "signal 2" - axisX: axisX - axisYRight: axisY2 - } -// ... -//![1] - - //![2] - Timer { - id: refreshTimer - interval: 1 / 60 * 1000 // 60 Hz - running: true - repeat: true - onTriggered: { - dataSource.update(chartView.series(0)); - dataSource.update(chartView.series(1)); - } - } - //![2] - - //![3] - function changeSeriesType(type) { - chartView.removeAllSeries(); - - // Create two new series of the correct type. Axis x is the same for both of the series, - // but the series have their own y-axes to make it possible to control the y-offset - // of the "signal sources". - if (type == "line") { - chartView.createSeries(ChartView.SeriesTypeLine, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeLine, "signal 2", axisX, axisY2); - } else if (type == "spline") { - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 2", axisX, axisY2); - } else { - var series1 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 1", axisX, axisY1); - series1.markerSize = 3; - series1.borderColor = "transparent"; - var series2 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 2", axisX, axisY2); - series2.markerSize = 3; - series2.borderColor = "transparent"; - } - } - - function createAxis(min, max) { - // The following creates a ValueAxis object that can be then set as a x or y axis for a series - return Qt.createQmlObject("import QtQuick 1.1; import QtCommercial.Chart 1.1; ValueAxis { min: " - + min + "; max: " + max + " }", chartView); - } - //![3] - - function setAnimations(enabled) { - if (enabled) - chartView.animationOptions = ChartView.SeriesAnimations; - else - chartView.animationOptions = ChartView.NoAnimation; - } - - function changeRefreshRate(rate) { - refreshTimer.interval = 1 / Number(rate) * 1000; - } -} diff --git a/demos/qmloscilloscope/qml/qmloscilloscope/main.qml b/demos/qmloscilloscope/qml/qmloscilloscope/main.qml deleted file mode 100644 index 2574e3bb..00000000 --- a/demos/qmloscilloscope/qml/qmloscilloscope/main.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -//![1] -Rectangle { - id: main - width: 460 - height: 350 - color: "#404040" - - ControlPanel { - id: controlPanel - anchors.top: parent.top - anchors.topMargin: 10 - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 10 -// ... -//![1] - - onSignalSourceChanged: { - if (source == "sin") - dataSource.generateData(0, signalCount, sampleCount); - else - dataSource.generateData(1, signalCount, sampleCount); - } - onAnimationsEnabled: scopeView.setAnimations(enabled); - onSeriesTypeChanged: scopeView.changeSeriesType(type); - onRefreshRateChanged: scopeView.changeRefreshRate(rate); - onAntialiasingEnabled: dataSource.setAntialiasing(enabled); - } - -//![2] - ScopeView { - id: scopeView - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: controlPanel.right - height: main.height - } -//![2] -} diff --git a/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmloscilloscope/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmloscilloscope/qmloscilloscope.pro b/demos/qmloscilloscope/qmloscilloscope.pro deleted file mode 100644 index 5bf080e8..00000000 --- a/demos/qmloscilloscope/qmloscilloscope.pro +++ /dev/null @@ -1,13 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp \ - datasource.cpp -OTHER_FILES += qml/qmloscilloscope/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) - -HEADERS += \ - datasource.h diff --git a/demos/qmloscilloscope/resources.qrc b/demos/qmloscilloscope/resources.qrc deleted file mode 100644 index e2aadae8..00000000 --- a/demos/qmloscilloscope/resources.qrc +++ /dev/null @@ -1,8 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmloscilloscope/main.qml</file> - <file>qml/qmloscilloscope/ControlPanel.qml</file> - <file>qml/qmloscilloscope/ScopeView.qml</file> - <file>qml/qmloscilloscope/MultiButton.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlpolarchart/main.cpp b/demos/qmlpolarchart/main.cpp deleted file mode 100644 index 27e6a540..00000000 --- a/demos/qmlpolarchart/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QDir> -#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/qmlpolarchart/loader.qml")); - viewer->setRenderHint(QPainter::Antialiasing, true); - viewer->showExpanded(); - - return app->exec(); -} diff --git a/demos/qmlpolarchart/qml/qmlpolarchart/View1.qml b/demos/qmlpolarchart/qml/qmlpolarchart/View1.qml deleted file mode 100644 index 4d9ef097..00000000 --- a/demos/qmlpolarchart/qml/qmlpolarchart/View1.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - anchors.fill: parent - //![1] - PolarChartView { - title: "Two Series, Common Axes" - anchors.fill: parent - legend.visible: false - - ValueAxis { - id: axisAngular - min: 0 - max: 20 - tickCount: 9 - } - - ValueAxis { - id: axisRadial - min: -0.5 - max: 1.5 - } - - SplineSeries { - id: series1 - axisAngular: axisAngular - axisRadial: axisRadial - pointsVisible: true - } - - ScatterSeries { - id: series2 - axisAngular: axisAngular - axisRadial: axisRadial - markerSize: 10 - } - } - - // Add data dynamically to the series - Component.onCompleted: { - for (var i = 0; i <= 20; i++) { - series1.append(i, Math.random()); - series2.append(i, Math.random()); - } - } - //![1] -} diff --git a/demos/qmlpolarchart/qml/qmlpolarchart/View2.qml b/demos/qmlpolarchart/qml/qmlpolarchart/View2.qml deleted file mode 100644 index b062c0c3..00000000 --- a/demos/qmlpolarchart/qml/qmlpolarchart/View2.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - anchors.fill: parent - - //![1] - PolarChartView { - title: "Historical Area Series" - anchors.fill: parent - legend.visible: false - - DateTimeAxis { - id: axis1 - format: "yyyy MMM" - tickCount: 13 - } - ValueAxis { - id: axis2 - } - LineSeries { - id: lowerLine - axisAngular: axis1 - axisRadial: axis2 - - // Please note that month in JavaScript months are zero based, so 2 means March - XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 15 } - XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 35 } - XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 50 } - XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 75 } - XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 102 } - XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 132 } - XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 100 } - XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 120 } - XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 140 } - XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 150 } - } - LineSeries { - id: upperLine - axisAngular: axis1 - axisRadial: axis2 - - // Please note that month in JavaScript months are zero based, so 2 means March - XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 30 } - XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 55 } - XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 80 } - XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 105 } - XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 125 } - XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 160 } - XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 140 } - XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 140 } - XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 170 } - XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 200 } - } - AreaSeries { - axisAngular: axis1 - axisRadial: axis2 - lowerSeries: lowerLine - upperSeries: upperLine - } - } - // DateTimeAxis is based on QDateTimes so we must convert our JavaScript dates to - // milliseconds since epoch to make them match the DateTimeAxis values - function toMsecsSinceEpoch(date) { - var msecs = date.getTime(); - return msecs; - } - //![1] -} diff --git a/demos/qmlpolarchart/qml/qmlpolarchart/View3.qml b/demos/qmlpolarchart/qml/qmlpolarchart/View3.qml deleted file mode 100644 index c671448f..00000000 --- a/demos/qmlpolarchart/qml/qmlpolarchart/View3.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - anchors.fill: parent - - //![1] - PolarChartView { - title: "Numerical Data for Dummies" - anchors.fill: parent - legend.visible: false - - LineSeries { - axisRadial: CategoryAxis { - min: 0 - max: 30 - CategoryRange { - label: "critical" - endValue: 2 - } - CategoryRange { - label: "low" - endValue: 7 - } - CategoryRange { - label: "normal" - endValue: 12 - } - CategoryRange { - label: "high" - endValue: 18 - } - CategoryRange { - label: "extremely high" - endValue: 30 - } - } - - axisAngular: ValueAxis { - tickCount: 13 - } - - XYPoint { x: 0; y: 4.3 } - XYPoint { x: 1; y: 4.1 } - XYPoint { x: 2; y: 4.7 } - XYPoint { x: 3; y: 3.9 } - XYPoint { x: 4; y: 5.2 } - XYPoint { x: 5; y: 5.3 } - XYPoint { x: 6; y: 6.1 } - XYPoint { x: 7; y: 7.7 } - XYPoint { x: 8; y: 12.9 } - XYPoint { x: 9; y: 19.2 } - } - } - //![1] -} diff --git a/demos/qmlpolarchart/qml/qmlpolarchart/loader.qml b/demos/qmlpolarchart/qml/qmlpolarchart/loader.qml deleted file mode 100644 index 06054d01..00000000 --- a/demos/qmlpolarchart/qml/qmlpolarchart/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Item { - id: container - width: 800 - height: 600 - Component.onCompleted: { - var co = Qt.createComponent("main.qml") - if (co.status == Component.Ready) { - var o = co.createObject(container) - } else { - console.log(co.errorString()) - console.log("QtCommercial.Chart 1.3 not available") - console.log("Please use correct QML_IMPORT_PATH export") - } - } -} diff --git a/demos/qmlpolarchart/qml/qmlpolarchart/main.qml b/demos/qmlpolarchart/qml/qmlpolarchart/main.qml deleted file mode 100644 index 56f5e288..00000000 --- a/demos/qmlpolarchart/qml/qmlpolarchart/main.qml +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 - -Rectangle { - width: parent.width - height: parent.height - property int viewNumber: 1 - property int viewCount: 3 - - Loader { - id: loader - anchors.fill: parent - source: "View" + viewNumber + ".qml"; - } - - Rectangle { - id: infoText - anchors.centerIn: parent - width: parent.width - height: 40 - color: "black" - Text { - color: "white" - anchors.centerIn: parent - text: "Use left and right arrow keys to navigate" - } - - Behavior on opacity { - NumberAnimation { duration: 400 } - } - } - - MouseArea { - focus: true - anchors.fill: parent - onClicked: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - nextView(); - } - } - Keys.onPressed: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - if (event.key == Qt.Key_Left) { - previousView(); - } else { - nextView(); - } - } - } - } - - function nextView() { - var i = viewNumber + 1; - if (i > viewCount) - viewNumber = 1; - else - viewNumber = i; - } - - function previousView() { - var i = viewNumber - 1; - if (i <= 0) - viewNumber = viewCount; - else - viewNumber = i; - } -} diff --git a/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlpolarchart/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlpolarchart/qmlpolarchart.pro b/demos/qmlpolarchart/qmlpolarchart.pro deleted file mode 100644 index f661312b..00000000 --- a/demos/qmlpolarchart/qmlpolarchart.pro +++ /dev/null @@ -1,9 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlpolarchart/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) diff --git a/demos/qmlpolarchart/resources.qrc b/demos/qmlpolarchart/resources.qrc deleted file mode 100644 index 854acbef..00000000 --- a/demos/qmlpolarchart/resources.qrc +++ /dev/null @@ -1,9 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlpolarchart/loader.qml</file> - <file>qml/qmlpolarchart/main.qml</file> - <file>qml/qmlpolarchart/View1.qml</file> - <file>qml/qmlpolarchart/View2.qml</file> - <file>qml/qmlpolarchart/View3.qml</file> - </qresource> -</RCC> diff --git a/demos/qmlweather/main.cpp b/demos/qmlweather/main.cpp deleted file mode 100644 index fee07449..00000000 --- a/demos/qmlweather/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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/QDeclarativeContext> -#include <QtDeclarative/QDeclarativeEngine> -#include <QDebug> -#include <QDir> -#include "qmlapplicationviewer.h" - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QScopedPointer<QApplication> app(createApplication(argc, argv)); - - QmlApplicationViewer viewer; -#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); - QString appKey; - if (argc > 1) { - appKey = argv[1]; - qDebug() << "App key for worldweatheronline.com:" << appKey; - } else { - qWarning() << "No app key for worldweatheronline.com given. Using static test data instead of live data."; - } - viewer.rootContext()->setContextProperty("weatherAppKey", appKey); - viewer.setSource(QUrl("qrc:/qml/qmlweather/main.qml")); - viewer.setRenderHint(QPainter::Antialiasing, true); - viewer.showExpanded(); - return app->exec(); -} diff --git a/demos/qmlweather/qml/qmlweather/main.qml b/demos/qmlweather/qml/qmlweather/main.qml deleted file mode 100644 index 16e48a38..00000000 --- a/demos/qmlweather/qml/qmlweather/main.qml +++ /dev/null @@ -1,200 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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.1 -import QtCommercial.Chart 1.2 - -Rectangle { - width: 500 - height: 400 - gradient: Gradient { - GradientStop { position: 0.0; color: "lightblue" } - GradientStop { position: 1.0; color: "white" } - } - - //![1] - ChartView { - id: chartView - title: "Weather forecast" - //![1] - anchors.top: parent.top - anchors.bottom: weatherImageRow.top - anchors.left: parent.left - anchors.right: parent.right - legend.alignment: Qt.AlignTop - - //![2] - BarCategoriesAxis { - id: barCategoriesAxis - titleText: "Date" - } - - ValueAxis{ - id: valueAxisY2 - min: 0 - max: 10 - titleText: "Rainfall [mm]" - } - - ValueAxis { - id: valueAxisX - // Hide the value axis; it is only used to map the line series to bar categories axis - visible: false - min: 0 - max: 5 - } - - ValueAxis{ - id: valueAxisY - min: 0 - max: 15 - titleText: "Temperature [°C]" - } - - LineSeries { - id: maxTempSeries - axisX: valueAxisX - axisY: valueAxisY - name: "Max. temperature" - } - - LineSeries { - id: minTempSeries - axisX: valueAxisX - axisY: valueAxisY - name: "Min. temperature" - } - - BarSeries { - id: myBarSeries - axisX: barCategoriesAxis - axisYRight: valueAxisY2 - BarSet { - id: rainfallSet - label: "Rainfall" - } - } - //![2] - } - - // A timer to refresh the forecast every 5 minutes - Timer { - interval: 300000 - repeat: true - triggeredOnStart: true - running: true - onTriggered: { - if (weatherAppKey != "") { - //![3] - // Make HTTP GET request and parse the result - var xhr = new XMLHttpRequest; - xhr.open("GET", - "http://free.worldweatheronline.com/feed/weather.ashx?q=Jyv%c3%a4skyl%c3%a4,Finland&format=json&num_of_days=5&key=" - + weatherAppKey); - xhr.onreadystatechange = function() { - if (xhr.readyState == XMLHttpRequest.DONE) { - var a = JSON.parse(xhr.responseText); - parseWeatherData(a); - } - } - xhr.send(); - //![3] - } else { - // No app key for worldweatheronline.com given by the user -> use dummy static data - var responseText = "{ \"data\": { \"current_condition\": [ {\"cloudcover\": \"10\", \"humidity\": \"61\", \"observation_time\": \"06:26 AM\", \"precipMM\": \"0.0\", \"pressure\": \"1022\", \"temp_C\": \"6\", \"temp_F\": \"43\", \"visibility\": \"10\", \"weatherCode\": \"113\", \"weatherDesc\": [ {\"value\": \"Sunny\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png\" } ], \"winddir16Point\": \"SE\", \"winddirDegree\": \"140\", \"windspeedKmph\": \"7\", \"windspeedMiles\": \"4\" } ], \"request\": [ {\"query\": \"Jyvaskyla, Finland\", \"type\": \"City\" } ], \"weather\": [ {\"date\": \"2012-05-09\", \"precipMM\": \"0.4\", \"tempMaxC\": \"14\", \"tempMaxF\": \"57\", \"tempMinC\": \"7\", \"tempMinF\": \"45\", \"weatherCode\": \"116\", \"weatherDesc\": [ {\"value\": \"Partly Cloudy\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png\" } ], \"winddir16Point\": \"S\", \"winddirDegree\": \"179\", \"winddirection\": \"S\", \"windspeedKmph\": \"20\", \"windspeedMiles\": \"12\" }, {\"date\": \"2012-05-10\", \"precipMM\": \"2.4\", \"tempMaxC\": \"13\", \"tempMaxF\": \"55\", \"tempMinC\": \"8\", \"tempMinF\": \"46\", \"weatherCode\": \"266\", \"weatherDesc\": [ {\"value\": \"Light drizzle\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0017_cloudy_with_light_rain.png\" } ], \"winddir16Point\": \"SW\", \"winddirDegree\": \"219\", \"winddirection\": \"SW\", \"windspeedKmph\": \"21\", \"windspeedMiles\": \"13\" }, {\"date\": \"2012-05-11\", \"precipMM\": \"11.1\", \"tempMaxC\": \"15\", \"tempMaxF\": \"59\", \"tempMinC\": \"7\", \"tempMinF\": \"44\", \"weatherCode\": \"266\", \"weatherDesc\": [ {\"value\": \"Light drizzle\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0017_cloudy_with_light_rain.png\" } ], \"winddir16Point\": \"SSW\", \"winddirDegree\": \"200\", \"winddirection\": \"SSW\", \"windspeedKmph\": \"20\", \"windspeedMiles\": \"12\" }, {\"date\": \"2012-05-12\", \"precipMM\": \"2.8\", \"tempMaxC\": \"7\", \"tempMaxF\": \"44\", \"tempMinC\": \"2\", \"tempMinF\": \"35\", \"weatherCode\": \"317\", \"weatherDesc\": [ {\"value\": \"Light sleet\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0021_cloudy_with_sleet.png\" } ], \"winddir16Point\": \"NW\", \"winddirDegree\": \"311\", \"winddirection\": \"NW\", \"windspeedKmph\": \"24\", \"windspeedMiles\": \"15\" }, {\"date\": \"2012-05-13\", \"precipMM\": \"0.4\", \"tempMaxC\": \"6\", \"tempMaxF\": \"42\", \"tempMinC\": \"2\", \"tempMinF\": \"35\", \"weatherCode\": \"116\", \"weatherDesc\": [ {\"value\": \"Partly Cloudy\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png\" } ], \"winddir16Point\": \"WNW\", \"winddirDegree\": \"281\", \"winddirection\": \"WNW\", \"windspeedKmph\": \"21\", \"windspeedMiles\": \"13\" } ] }}"; - var a = JSON.parse(responseText); - parseWeatherData(a); - } - } - } - - Row { - id: weatherImageRow - anchors.bottom: poweredByText.top - anchors.bottomMargin: 10 - anchors.left: parent.left - anchors.leftMargin: 25 - anchors.right: parent.right - anchors.rightMargin: 25 - - ListModel { - id: weatherImageModel - } - - Repeater { - id: repeater - model: weatherImageModel - delegate: Image { - source: imageSource - width: weatherImageRow.width / weatherImageModel.count - height: width - fillMode: Image.PreserveAspectCrop - } - } - } - - Text { - id: poweredByText - anchors.bottom: parent.bottom - anchors.bottomMargin: 10 - anchors.left: parent.left - anchors.leftMargin: 25 - text: "Powered by World Weather Online" - } - - function parseWeatherData(weatherData) { - // Clear previous values - maxTempSeries.clear(); - minTempSeries.clear(); - weatherImageModel.clear(); - - //![4] - // Loop through the parsed JSON - for (var i in weatherData.data.weather) { - var weatherObj = weatherData.data.weather[i]; - //![4] - - //![5] - // Store temperature values, rainfall and weather icon. - // The temperature values begin from 0.5 instead of 0.0 to make the start from the - // middle of the rainfall bars. This makes the temperature lines visually better - // synchronized with the rainfall bars. - maxTempSeries.append(Number(i) + 0.5, weatherObj.tempMaxC); - minTempSeries.append(Number(i) + 0.5, weatherObj.tempMinC); - rainfallSet.append(i, weatherObj.precipMM); - weatherImageModel.append({"imageSource":weatherObj.weatherIconUrl[0].value}); - //![5] - - // Update scale of the chart - valueAxisY.max = Math.max(chartView.axisY().max,weatherObj.tempMaxC); - valueAxisX.min = 0; - valueAxisX.max = Number(i) + 1; - - // Set the x-axis labels to the dates of the forecast - var xLabels = barCategoriesAxis.categories; - xLabels[Number(i)] = weatherObj.date.substring(5, 10); - barCategoriesAxis.categories = xLabels; - barCategoriesAxis.visible = true; - barCategoriesAxis.min = 0; - barCategoriesAxis.max = xLabels.length - 1; - } - } - -} diff --git a/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index cb227056..00000000 --- a/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// 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/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.h b/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index adcb232f..00000000 --- a/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,46 +0,0 @@ -// checksum 0xc67a 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. -*/ - -#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/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.pri deleted file mode 100644 index 567c6dc6..00000000 --- a/demos/qmlweather/qmlapplicationviewer/qmlapplicationviewer.pri +++ /dev/null @@ -1,13 +0,0 @@ -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/demos/qmlweather/qmlweather.pro b/demos/qmlweather/qmlweather.pro deleted file mode 100644 index 52fa5716..00000000 --- a/demos/qmlweather/qmlweather.pro +++ /dev/null @@ -1,10 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/qmlweather/* - -include(qmlapplicationviewer/qmlapplicationviewer.pri) - diff --git a/demos/qmlweather/resources.qrc b/demos/qmlweather/resources.qrc deleted file mode 100644 index 7205906f..00000000 --- a/demos/qmlweather/resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/qmlweather/main.qml</file> - </qresource> -</RCC> diff --git a/demos/quick2chart/main.cpp b/demos/quick2chart/main.cpp deleted file mode 100644 index 04913d00..00000000 --- a/demos/quick2chart/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QtWidgets/QApplication> -#include <QtQuick/QQuickItem> -#include <QDir> -#include <QtQml/QQmlEngine> -#include "qtquick2applicationviewer.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QtQuick2ApplicationViewer viewer; -#ifdef Q_OS_ANDROID - viewer.addImportPath(QString::fromLatin1("assets:/qml")); - 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("qml"))); -#endif - viewer.setSource(QUrl("qrc:/qml/quick2chart/main.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/demos/quick2chart/qml/quick2chart/View1.qml b/demos/quick2chart/qml/quick2chart/View1.qml deleted file mode 100644 index e3850ae1..00000000 --- a/demos/quick2chart/qml/quick2chart/View1.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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$ -** -****************************************************************************/ - -//![2] -import QtQuick 2.0 -//![2] -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - property variant othersSlice: 0 - - //![1] - ChartView { - id: chart - title: "Top-5 car brand shares in Finland" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - PieSeries { - id: pieSeries - PieSlice { label: "Volkswagen"; value: 13.5 } - PieSlice { label: "Toyota"; value: 10.9 } - PieSlice { label: "Ford"; value: 8.6 } - PieSlice { label: "Skoda"; value: 8.2 } - PieSlice { label: "Volvo"; value: 6.8 } - } - } - - Component.onCompleted: { - // You can also manipulate slices dynamically - othersSlice = pieSeries.append("Others", 52.0); - pieSeries.find("Volkswagen").exploded = true; - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View10.qml b/demos/quick2chart/qml/quick2chart/View10.qml deleted file mode 100644 index 2a5a2973..00000000 --- a/demos/quick2chart/qml/quick2chart/View10.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Stacked Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - HorizontalStackedBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View11.qml b/demos/quick2chart/qml/quick2chart/View11.qml deleted file mode 100644 index 2b2d444a..00000000 --- a/demos/quick2chart/qml/quick2chart/View11.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Percent Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - HorizontalPercentBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} - diff --git a/demos/quick2chart/qml/quick2chart/View12.qml b/demos/quick2chart/qml/quick2chart/View12.qml deleted file mode 100644 index 74d97896..00000000 --- a/demos/quick2chart/qml/quick2chart/View12.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - id: chart - title: "Production costs" - anchors.fill: parent - legend.visible: false - antialiasing: true - - PieSeries { - id: pieOuter - size: 0.96 - holeSize: 0.7 - PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" } - PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" } - PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" } - } - - PieSeries { - size: 0.7 - id: pieInner - holeSize: 0.25 - - PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" } - PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" } - PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" } - - PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" } - PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" } - PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" } - - PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" } - PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" } - PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" } - } - } - - Component.onCompleted: { - // Set the common slice properties dynamically for convenience - for (var i = 0; i < pieOuter.count; i++) { - pieOuter.at(i).labelPosition = PieSlice.LabelOutside; - pieOuter.at(i).labelVisible = true; - pieOuter.at(i).borderWidth = 3; - } - for (var i = 0; i < pieInner.count; i++) { - pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal; - pieInner.at(i).labelVisible = true; - pieInner.at(i).borderWidth = 2; - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View2.qml b/demos/quick2chart/qml/quick2chart/View2.qml deleted file mode 100644 index a7e0ace4..00000000 --- a/demos/quick2chart/qml/quick2chart/View2.qml +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Line" - anchors.fill: parent - antialiasing: true - - LineSeries { - name: "LineSeries" - XYPoint { x: 0; y: 0 } - XYPoint { x: 1.1; y: 2.1 } - XYPoint { x: 1.9; y: 3.3 } - XYPoint { x: 2.1; y: 2.1 } - XYPoint { x: 2.9; y: 4.9 } - XYPoint { x: 3.4; y: 3.0 } - XYPoint { x: 4.1; y: 3.3 } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View3.qml b/demos/quick2chart/qml/quick2chart/View3.qml deleted file mode 100644 index d56ceeb2..00000000 --- a/demos/quick2chart/qml/quick2chart/View3.qml +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Spline" - anchors.fill: parent - antialiasing: true - - SplineSeries { - name: "SplineSeries" - XYPoint { x: 0; y: 0.0 } - XYPoint { x: 1.1; y: 3.2 } - XYPoint { x: 1.9; y: 2.4 } - XYPoint { x: 2.1; y: 2.1 } - XYPoint { x: 2.9; y: 2.6 } - XYPoint { x: 3.4; y: 2.3 } - XYPoint { x: 4.1; y: 3.1 } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View4.qml b/demos/quick2chart/qml/quick2chart/View4.qml deleted file mode 100644 index 5ca59061..00000000 --- a/demos/quick2chart/qml/quick2chart/View4.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "NHL All-Star Team Players" - anchors.fill: parent - antialiasing: true - - ValueAxis { - id: valueAxis - min: 2000 - max: 2011 - tickCount: 12 - labelFormat: "%.0f" - } - - AreaSeries { - name: "Russian" - color: "#FFD52B1E" - borderColor: "#FF0039A5" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 1 } - XYPoint { x: 2001; y: 1 } - XYPoint { x: 2002; y: 1 } - XYPoint { x: 2003; y: 1 } - XYPoint { x: 2004; y: 1 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 1 } - XYPoint { x: 2007; y: 1 } - XYPoint { x: 2008; y: 4 } - XYPoint { x: 2009; y: 3 } - XYPoint { x: 2010; y: 2 } - XYPoint { x: 2011; y: 1 } - } - } - // ... - //![1] - - AreaSeries { - name: "Swedish" - color: "#AF005292" - borderColor: "#AFFDCA00" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 1 } - XYPoint { x: 2001; y: 1 } - XYPoint { x: 2002; y: 3 } - XYPoint { x: 2003; y: 3 } - XYPoint { x: 2004; y: 2 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 2 } - XYPoint { x: 2007; y: 1 } - XYPoint { x: 2008; y: 2 } - XYPoint { x: 2009; y: 1 } - XYPoint { x: 2010; y: 3 } - XYPoint { x: 2011; y: 3 } - } - } - - AreaSeries { - name: "Finnish" - color: "#00357F" - borderColor: "#FEFEFE" - borderWidth: 3 - axisX: valueAxis - upperSeries: LineSeries { - XYPoint { x: 2000; y: 0 } - XYPoint { x: 2001; y: 0 } - XYPoint { x: 2002; y: 0 } - XYPoint { x: 2003; y: 0 } - XYPoint { x: 2004; y: 0 } - XYPoint { x: 2005; y: 0 } - XYPoint { x: 2006; y: 1 } - XYPoint { x: 2007; y: 0 } - XYPoint { x: 2008; y: 0 } - XYPoint { x: 2009; y: 0 } - XYPoint { x: 2010; y: 0 } - XYPoint { x: 2011; y: 1 } - } - } - } -} diff --git a/demos/quick2chart/qml/quick2chart/View5.qml b/demos/quick2chart/qml/quick2chart/View5.qml deleted file mode 100644 index 4b0882cb..00000000 --- a/demos/quick2chart/qml/quick2chart/View5.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Scatters" - anchors.fill: parent - antialiasing: true - - ScatterSeries { - id: scatter1 - name: "Scatter1" - XYPoint { x: 1.5; y: 1.5 } - XYPoint { x: 1.5; y: 1.6 } - XYPoint { x: 1.57; y: 1.55 } - XYPoint { x: 1.8; y: 1.8 } - XYPoint { x: 1.9; y: 1.6 } - XYPoint { x: 2.1; y: 1.3 } - XYPoint { x: 2.5; y: 2.1 } - } - - ScatterSeries { - name: "Scatter2" - // ... - //![1] - XYPoint { x: 2.0; y: 2.0 } - XYPoint { x: 2.0; y: 2.1 } - XYPoint { x: 2.07; y: 2.05 } - XYPoint { x: 2.2; y: 2.9 } - XYPoint { x: 2.4; y: 2.7 } - XYPoint { x: 2.67; y: 2.65 } - } - } -} diff --git a/demos/quick2chart/qml/quick2chart/View6.qml b/demos/quick2chart/qml/quick2chart/View6.qml deleted file mode 100644 index b9db3aca..00000000 --- a/demos/quick2chart/qml/quick2chart/View6.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - BarSeries { - id: mySeries - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View7.qml b/demos/quick2chart/qml/quick2chart/View7.qml deleted file mode 100644 index 998097a7..00000000 --- a/demos/quick2chart/qml/quick2chart/View7.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Stacked Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - StackedBarSeries { - id: mySeries - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View8.qml b/demos/quick2chart/qml/quick2chart/View8.qml deleted file mode 100644 index fcb8a729..00000000 --- a/demos/quick2chart/qml/quick2chart/View8.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Percent Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - PercentBarSeries { - axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} diff --git a/demos/quick2chart/qml/quick2chart/View9.qml b/demos/quick2chart/qml/quick2chart/View9.qml deleted file mode 100644 index 5ba3d365..00000000 --- a/demos/quick2chart/qml/quick2chart/View9.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.1 - -Rectangle { - anchors.fill: parent - - //![1] - ChartView { - title: "Horizontal Bar series" - anchors.fill: parent - legend.alignment: Qt.AlignBottom - antialiasing: true - - HorizontalBarSeries { - axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] } - BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] } - BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] } - BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] } - } - } - //![1] -} - diff --git a/demos/quick2chart/qml/quick2chart/loader.qml b/demos/quick2chart/qml/quick2chart/loader.qml deleted file mode 100644 index f9b7569a..00000000 --- a/demos/quick2chart/qml/quick2chart/loader.qml +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 - -Item { - id: container - width: 600 - height: 400 - Component.onCompleted: { - var co = Qt.createComponent("main.qml") - if (co.status == Component.Ready) { - var o = co.createObject(container) - } else { - console.log(co.errorString()) - console.log("QtCommercial.Chart 1.1 not available") - console.log("Please use correct QML_IMPORT_PATH export") - } - } -} diff --git a/demos/quick2chart/qml/quick2chart/main.qml b/demos/quick2chart/qml/quick2chart/main.qml deleted file mode 100644 index 2f52d578..00000000 --- a/demos/quick2chart/qml/quick2chart/main.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -//![1] - -Rectangle { - width: 600 - height: 400 - property int viewNumber: 1 - - Loader { - id: loader - anchors.fill: parent - source: "View" + viewNumber + ".qml"; - } - - Rectangle { - id: infoText - anchors.centerIn: parent - width: parent.width - height: 40 - color: "black" - Text { - color: "white" - anchors.centerIn: parent - text: "Use left and right arrow keys to navigate between chart types" - } - - Behavior on opacity { - NumberAnimation { duration: 400 } - } - } - - MouseArea { - focus: true - anchors.fill: parent - onClicked: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - nextView(); - } - } - Keys.onPressed: { - if (infoText.opacity > 0) { - infoText.opacity = 0.0; - } else { - if (event.key == Qt.Key_Left) { - previousView(); - } else { - nextView(); - } - } - } - } - - function nextView() { - var i = viewNumber + 1; - if (i > 12) - viewNumber = 1; - else - viewNumber = i; - } - - function previousView() { - var i = viewNumber - 1; - if (i <= 0) - viewNumber = 12; - else - viewNumber = i; - } -} diff --git a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp deleted file mode 100644 index b58190f6..00000000 --- a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// checksum 0xc01f version 0x90005 -/* - This file was generated by the Qt Quick 2 Application wizard of Qt Creator. - QtQuick2ApplicationViewer 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 "qtquick2applicationviewer.h" - -#include <QtCore/QCoreApplication> -#include <QtCore/QDir> -#include <QtQml/QQmlEngine> - -class QtQuick2ApplicationViewerPrivate -{ - QString mainQmlFile; - friend class QtQuick2ApplicationViewer; - static QString adjustPath(const QString &path); -}; - -QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) -{ -#if defined(Q_OS_IOS) - if (!QDir::isAbsolutePath(path)) - return QString::fromLatin1("%1/%2") - .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(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; -#elif defined(Q_OS_ANDROID_NO_SDK) - return QLatin1String("/data/user/qt/") + path; -#endif - return path; -} - -QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent) - : QQuickView(parent) - , d(new QtQuick2ApplicationViewerPrivate()) -{ - connect(engine(), SIGNAL(quit()), SLOT(close())); - setResizeMode(QQuickView::SizeRootObjectToView); -} - -QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() -{ - delete d; -} - -void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) -{ - d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) - setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); -#else - setSource(QUrl::fromLocalFile(d->mainQmlFile)); -#endif -} - -void QtQuick2ApplicationViewer::addImportPath(const QString &path) -{ - engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path)); -} - -void QtQuick2ApplicationViewer::showExpanded() -{ -#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX) - showFullScreen(); -#else - show(); -#endif -} diff --git a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h deleted file mode 100644 index cf66f140..00000000 --- a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h +++ /dev/null @@ -1,33 +0,0 @@ -// checksum 0xfde6 version 0x90005 -/* - This file was generated by the Qt Quick 2 Application wizard of Qt Creator. - QtQuick2ApplicationViewer 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 QTQUICK2APPLICATIONVIEWER_H -#define QTQUICK2APPLICATIONVIEWER_H - -#include <QtQuick/QQuickView> - -class QtQuick2ApplicationViewer : public QQuickView -{ - Q_OBJECT - -public: - explicit QtQuick2ApplicationViewer(QWindow *parent = 0); - virtual ~QtQuick2ApplicationViewer(); - - void setMainQmlFile(const QString &file); - void addImportPath(const QString &path); - - void showExpanded(); - -private: - class QtQuick2ApplicationViewerPrivate *d; -}; - -#endif // QTQUICK2APPLICATIONVIEWER_H diff --git a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.pri b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.pri deleted file mode 100644 index b2d0f51d..00000000 --- a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.pri +++ /dev/null @@ -1,6 +0,0 @@ -QT += qml quick widgets - -SOURCES += $$PWD/qtquick2applicationviewer.cpp -HEADERS += $$PWD/qtquick2applicationviewer.h -INCLUDEPATH += $$PWD - diff --git a/demos/quick2chart/quick2chart.pro b/demos/quick2chart/quick2chart.pro deleted file mode 100644 index 006d47f9..00000000 --- a/demos/quick2chart/quick2chart.pro +++ /dev/null @@ -1,10 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp -OTHER_FILES += qml/quick2chart/* - -include(qtquick2applicationviewer/qtquick2applicationviewer.pri) - diff --git a/demos/quick2chart/resources.qrc b/demos/quick2chart/resources.qrc deleted file mode 100644 index 853f4423..00000000 --- a/demos/quick2chart/resources.qrc +++ /dev/null @@ -1,18 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/quick2chart/loader.qml</file> - <file>qml/quick2chart/main.qml</file> - <file>qml/quick2chart/View1.qml</file> - <file>qml/quick2chart/View2.qml</file> - <file>qml/quick2chart/View3.qml</file> - <file>qml/quick2chart/View4.qml</file> - <file>qml/quick2chart/View5.qml</file> - <file>qml/quick2chart/View6.qml</file> - <file>qml/quick2chart/View7.qml</file> - <file>qml/quick2chart/View8.qml</file> - <file>qml/quick2chart/View9.qml</file> - <file>qml/quick2chart/View10.qml</file> - <file>qml/quick2chart/View11.qml</file> - <file>qml/quick2chart/View12.qml</file> - </qresource> -</RCC> diff --git a/demos/quick2oscilloscope/datasource.cpp b/demos/quick2oscilloscope/datasource.cpp deleted file mode 100644 index 48b2ecfb..00000000 --- a/demos/quick2oscilloscope/datasource.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 "datasource.h" -#include <QXYSeries> -#include <QAreaSeries> -#include <QtQuick/QQuickView> -#include <QtQuick/QQuickItem> -#include <QDebug> -#include <qmath.h> - -QTCOMMERCIALCHART_USE_NAMESPACE - -Q_DECLARE_METATYPE(QAbstractSeries *) -Q_DECLARE_METATYPE(QAbstractAxis *) - -DataSource::DataSource(QQuickView *appViewer, QObject *parent) : - QObject(parent), - m_appViewer(appViewer), - m_index(-1) -{ - qRegisterMetaType<QAbstractSeries*>(); - qRegisterMetaType<QAbstractAxis*>(); - - generateData(0, 5, 1024); -} - -void DataSource::update(QAbstractSeries *series) -{ - if (series) { - QXYSeries *xySeries = static_cast<QXYSeries *>(series); - m_index++; - if (m_index > m_data.count() - 1) - m_index = 0; - - QList<QPointF> points = m_data.at(m_index); - // Use replace instead of clear + append, it's optimized for performance - xySeries->replace(points); - } -} - -void DataSource::generateData(int type, int rowCount, int colCount) -{ - // Remove previous data - foreach (QList<QPointF> row, m_data) - row.clear(); - m_data.clear(); - - // Append the new data depending on the type - for (int i(0); i < rowCount; i++) { - QList<QPointF> points; - for (int j(0); j < colCount; j++) { - qreal x(0); - qreal y(0); - switch (type) { - case 0: - // data with sin + random component - y = qSin(3.14159265358979 / 50 * j) + 0.5 + (qreal) rand() / (qreal) RAND_MAX; - x = j; - break; - case 1: - // linear data - x = j; - y = (qreal) i / 10; - break; - default: - // unknown, do nothing - break; - } - points.append(QPointF(x, y)); - } - m_data.append(points); - } -} diff --git a/demos/quick2oscilloscope/datasource.h b/demos/quick2oscilloscope/datasource.h deleted file mode 100644 index 3670a7d5..00000000 --- a/demos/quick2oscilloscope/datasource.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 DATASOURCE_H -#define DATASOURCE_H - -#include <QObject> -#include <QAbstractSeries> - -class QQuickView; - -QTCOMMERCIALCHART_USE_NAMESPACE - -class DataSource : public QObject -{ - Q_OBJECT -public: - explicit DataSource(QQuickView *appViewer, QObject *parent = 0); - -signals: - -public slots: - void generateData(int type, int rowCount, int colCount); - void update(QAbstractSeries *series); - -private: - QQuickView *m_appViewer; - QList<QList<QPointF> > m_data; - int m_index; -}; - -#endif // DATASOURCE_H diff --git a/demos/quick2oscilloscope/main.cpp b/demos/quick2oscilloscope/main.cpp deleted file mode 100644 index 1d733c9b..00000000 --- a/demos/quick2oscilloscope/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 <QtWidgets/QApplication> -#include <QtQuick/QQuickItem> -#include <QtQml/QQmlContext> -#include <QtQml/QQmlEngine> -#include <QDir> -#include "qtquick2applicationviewer.h" -#include "datasource.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QtQuick2ApplicationViewer viewer; -#ifdef Q_OS_ANDROID - viewer.addImportPath(QString::fromLatin1("assets:/qml")); - 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("qml"))); -#endif - - DataSource dataSource(&viewer); - viewer.rootContext()->setContextProperty("dataSource", &dataSource); - - viewer.setSource(QUrl("qrc:/qml/quick2oscilloscope/main.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/demos/quick2oscilloscope/qml/quick2oscilloscope/ControlPanel.qml b/demos/quick2oscilloscope/qml/quick2oscilloscope/ControlPanel.qml deleted file mode 100644 index 74041410..00000000 --- a/demos/quick2oscilloscope/qml/quick2oscilloscope/ControlPanel.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 - -Column { - spacing: 8 - signal animationsEnabled(bool enabled) - signal seriesTypeChanged(string type) - signal refreshRateChanged(variant rate); - signal signalSourceChanged(string source, int signalCount, int sampleCount); - signal antialiasingEnabled(bool enabled) - - Text { - text: "Scope" - font.pointSize: 18 - color: "white" - } - - MultiButton { - text: "Graph: " - items: ["line", "spline", "scatter"] - currentSelection: 0 - onSelectionChanged: seriesTypeChanged(items[currentSelection]); - } - - MultiButton { - id: signalSourceButton - text: "Source: " - items: ["sin", "linear"] - currentSelection: 0 - onSelectionChanged: signalSourceChanged( - selection, - 5, - sampleCountButton.items[sampleCountButton.currentSelection]); - } - - MultiButton { - id: sampleCountButton - text: "Samples: " - items: [6, 128, 1024, 10000] - currentSelection: 2 - onSelectionChanged: signalSourceChanged( - signalSourceButton.items[signalSourceButton.currentSelection], - 5, - selection); - } - - MultiButton { - text: "Refresh rate: " - items: [1, 24, 60, 100] - currentSelection: 2 - onSelectionChanged: refreshRateChanged(items[currentSelection]); - } - - MultiButton { - text: "Animations: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: animationsEnabled(currentSelection == 1); - } - - MultiButton { - text: "Antialias: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: antialiasingEnabled(currentSelection == 1); - } -} diff --git a/demos/quick2oscilloscope/qml/quick2oscilloscope/MultiButton.qml b/demos/quick2oscilloscope/qml/quick2oscilloscope/MultiButton.qml deleted file mode 100644 index 072e8019..00000000 --- a/demos/quick2oscilloscope/qml/quick2oscilloscope/MultiButton.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 - -Rectangle { - id: button - width: 115 - height: 31 - gradient: Gradient { - GradientStop { position: mouseArea.pressed ? 1.0 : 0.0; color: "#A09090" } - GradientStop { position: mouseArea.pressed ? 0.0 : 1.0; color: "#505050" } - } - smooth: true - - radius: 7 - property string text: "Option: " - property variant items: ["first"] - property int currentSelection: 0 - signal selectionChanged(variant selection) - - Text { - id: buttonText - anchors.centerIn: parent - color: "#FFFFFF" - text: button.text + button.items[currentSelection] - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - currentSelection = (currentSelection + 1) % items.length; - selectionChanged(button.items[currentSelection]); - } - } -} diff --git a/demos/quick2oscilloscope/qml/quick2oscilloscope/ScopeView.qml b/demos/quick2oscilloscope/qml/quick2oscilloscope/ScopeView.qml deleted file mode 100644 index bdab2604..00000000 --- a/demos/quick2oscilloscope/qml/quick2oscilloscope/ScopeView.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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 2.0 -import QtCommercial.Chart 1.2 - -//![1] -ChartView { - id: chartView - animationOptions: ChartView.NoAnimation - theme: ChartView.ChartThemeDark - - ValueAxis { - id: axisY1 - min: -1 - max: 4 - } - - ValueAxis { - id: axisY2 - min: -10 - max: 5 - } - - ValueAxis { - id: axisX - min: 0 - max: 1000 - } - - LineSeries { - id: lineSeries1 - name: "signal 1" - axisX: axisX - axisY: axisY1 - } - LineSeries { - id: lineSeries2 - name: "signal 2" - axisX: axisX - axisYRight: axisY2 - } -// ... -//![1] - - //![2] - Timer { - id: refreshTimer - interval: 1 / 60 * 1000 // 60 Hz - running: true - repeat: true - onTriggered: { - dataSource.update(chartView.series(0)); - dataSource.update(chartView.series(1)); - } - } - //![2] - - //![3] - function changeSeriesType(type) { - chartView.removeAllSeries(); - - // Create two new series of the correct type. Axis x is the same for both of the series, - // but the series have their own y-axes to make it possible to control the y-offset - // of the "signal sources". - if (type == "line") { - chartView.createSeries(ChartView.SeriesTypeLine, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeLine, "signal 2", axisX, axisY2); - } else if (type == "spline") { - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 2", axisX, axisY2); - } else { - var series1 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 1", axisX, axisY1); - series1.markerSize = 3; - series1.borderColor = "transparent"; - var series2 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 2", axisX, axisY2); - series2.markerSize = 3; - series2.borderColor = "transparent"; - } - } - - function createAxis(min, max) { - // The following creates a ValueAxis object that can be then set as a x or y axis for a series - return Qt.createQmlObject("import QtQuick 1.1; import QtCommercial.Chart 1.1; ValueAxis { min: " - + min + "; max: " + max + " }", chartView); - } - //![3] - - function setAnimations(enabled) { - if (enabled) - chartView.animationOptions = ChartView.SeriesAnimations; - else - chartView.animationOptions = ChartView.NoAnimation; - } - - function changeRefreshRate(rate) { - refreshTimer.interval = 1 / Number(rate) * 1000; - } -} diff --git a/demos/quick2oscilloscope/qml/quick2oscilloscope/main.qml b/demos/quick2oscilloscope/qml/quick2oscilloscope/main.qml deleted file mode 100644 index 8b00f355..00000000 --- a/demos/quick2oscilloscope/qml/quick2oscilloscope/main.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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 Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise 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$ -** -****************************************************************************/ - -//![3] -import QtQuick 2.0 -//![3] - -//![1] -Rectangle { - id: main - width: 400 - height: 300 - color: "#404040" - - ControlPanel { - id: controlPanel - anchors.top: parent.top - anchors.topMargin: 10 - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 10 -// ... -//![1] - - onSignalSourceChanged: { - if (source == "sin") - dataSource.generateData(0, signalCount, sampleCount); - else - dataSource.generateData(1, signalCount, sampleCount); - } - onAnimationsEnabled: scopeView.setAnimations(enabled); - onSeriesTypeChanged: scopeView.changeSeriesType(type); - onRefreshRateChanged: scopeView.changeRefreshRate(rate); - onAntialiasingEnabled: scopeView.antialiasing = enabled; - } - -//![2] - ScopeView { - id: scopeView - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: controlPanel.right - height: main.height - } -//![2] -} diff --git a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp deleted file mode 100644 index b58190f6..00000000 --- a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// checksum 0xc01f version 0x90005 -/* - This file was generated by the Qt Quick 2 Application wizard of Qt Creator. - QtQuick2ApplicationViewer 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 "qtquick2applicationviewer.h" - -#include <QtCore/QCoreApplication> -#include <QtCore/QDir> -#include <QtQml/QQmlEngine> - -class QtQuick2ApplicationViewerPrivate -{ - QString mainQmlFile; - friend class QtQuick2ApplicationViewer; - static QString adjustPath(const QString &path); -}; - -QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) -{ -#if defined(Q_OS_IOS) - if (!QDir::isAbsolutePath(path)) - return QString::fromLatin1("%1/%2") - .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(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; -#elif defined(Q_OS_ANDROID_NO_SDK) - return QLatin1String("/data/user/qt/") + path; -#endif - return path; -} - -QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent) - : QQuickView(parent) - , d(new QtQuick2ApplicationViewerPrivate()) -{ - connect(engine(), SIGNAL(quit()), SLOT(close())); - setResizeMode(QQuickView::SizeRootObjectToView); -} - -QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() -{ - delete d; -} - -void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) -{ - d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) - setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); -#else - setSource(QUrl::fromLocalFile(d->mainQmlFile)); -#endif -} - -void QtQuick2ApplicationViewer::addImportPath(const QString &path) -{ - engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path)); -} - -void QtQuick2ApplicationViewer::showExpanded() -{ -#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX) - showFullScreen(); -#else - show(); -#endif -} diff --git a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h deleted file mode 100644 index cf66f140..00000000 --- a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h +++ /dev/null @@ -1,33 +0,0 @@ -// checksum 0xfde6 version 0x90005 -/* - This file was generated by the Qt Quick 2 Application wizard of Qt Creator. - QtQuick2ApplicationViewer 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 QTQUICK2APPLICATIONVIEWER_H -#define QTQUICK2APPLICATIONVIEWER_H - -#include <QtQuick/QQuickView> - -class QtQuick2ApplicationViewer : public QQuickView -{ - Q_OBJECT - -public: - explicit QtQuick2ApplicationViewer(QWindow *parent = 0); - virtual ~QtQuick2ApplicationViewer(); - - void setMainQmlFile(const QString &file); - void addImportPath(const QString &path); - - void showExpanded(); - -private: - class QtQuick2ApplicationViewerPrivate *d; -}; - -#endif // QTQUICK2APPLICATIONVIEWER_H diff --git a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.pri b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.pri deleted file mode 100644 index b2d0f51d..00000000 --- a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.pri +++ /dev/null @@ -1,6 +0,0 @@ -QT += qml quick widgets - -SOURCES += $$PWD/qtquick2applicationviewer.cpp -HEADERS += $$PWD/qtquick2applicationviewer.h -INCLUDEPATH += $$PWD - diff --git a/demos/quick2oscilloscope/quick2oscilloscope.pro b/demos/quick2oscilloscope/quick2oscilloscope.pro deleted file mode 100644 index 3f5575a6..00000000 --- a/demos/quick2oscilloscope/quick2oscilloscope.pro +++ /dev/null @@ -1,13 +0,0 @@ -!include( ../demos.pri ) { - error( "Couldn't find the demos.pri file!" ) -} - -RESOURCES += resources.qrc -SOURCES += main.cpp \ - datasource.cpp -OTHER_FILES += qml/quick2oscilloscope/* - -include(qtquick2applicationviewer/qtquick2applicationviewer.pri) - -HEADERS += \ - datasource.h diff --git a/demos/quick2oscilloscope/resources.qrc b/demos/quick2oscilloscope/resources.qrc deleted file mode 100644 index 87208ca4..00000000 --- a/demos/quick2oscilloscope/resources.qrc +++ /dev/null @@ -1,8 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/quick2oscilloscope/main.qml</file> - <file>qml/quick2oscilloscope/ControlPanel.qml</file> - <file>qml/quick2oscilloscope/ScopeView.qml</file> - <file>qml/quick2oscilloscope/MultiButton.qml</file> - </qresource> -</RCC> |