diff options
author | Marek Rosa <marek.rosa@digia.com> | 2012-12-14 13:31:27 +0200 |
---|---|---|
committer | Marek Rosa <marek.rosa@digia.com> | 2012-12-14 13:35:55 +0200 |
commit | 1e18d6a3f6b0e81e76009654a5eb9285cfcce598 (patch) | |
tree | e0e3f46e22304aff40ea49b0e6c7659d4bdc8333 /demos | |
parent | ac10643c564238e0269d3b6493a349f5d882c1fc (diff) |
ChartViewer moved to tests
Diffstat (limited to 'demos')
56 files changed, 1 insertions, 4475 deletions
diff --git a/demos/chartviewer/charts.h b/demos/chartviewer/charts.h deleted file mode 100644 index 5c953107..00000000 --- a/demos/chartviewer/charts.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef CHARTS_H -#define CHARTS_H -#include "model.h" -#include <QList> -#include <QString> -#include <qchartglobal.h> - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -class Chart -{ -public: - virtual ~Chart() {}; - virtual QChart *createChart(const DataTable &table) = 0; - virtual QString name() = 0; - virtual QString category() = 0; - virtual QString subCategory() = 0; - -}; - -namespace Charts -{ - - typedef QList<Chart *> ChartList; - - inline ChartList &chartList() - { - static ChartList list; - return list; - } - - inline bool findChart(Chart *chart) - { - ChartList &list = chartList(); - if (list.contains(chart)) - return true; - - foreach (Chart *item, list) { - if (item->name() == chart->name() && item->category() == chart->category() && item->subCategory() == chart->subCategory()) - return true; - } - return false; - } - - inline void addChart(Chart *chart) - { - ChartList &list = chartList(); - if (!findChart(chart)) - list.append(chart); - } -} - -template <class T> -class ChartWrapper -{ -public: - QSharedPointer<T> chart; - ChartWrapper() : chart(new T) { Charts::addChart(chart.data()); } -}; - -#define DECLARE_CHART(chartType) static ChartWrapper<chartType> chartType; -#define DECLARE_CHART_TEMPLATE(chartType,chartName) static ChartWrapper<chartType> chartName; - -#endif diff --git a/demos/chartviewer/charts/axis/barcategoryaxisx.cpp b/demos/chartviewer/charts/axis/barcategoryaxisx.cpp deleted file mode 100644 index ce8cff36..00000000 --- a/demos/chartviewer/charts/axis/barcategoryaxisx.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qbarseries.h" -#include "qbarset.h" -#include "qvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarCategoryAxisX: public Chart -{ -public: - QString name() { return "AxisX"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "BarCategoryAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle(" BarCateogry X , Value Y"); - - QString name("Series "); - QBarSeries *series = new QBarSeries(chart); - QValueAxis *valueaxis = new QValueAxis(); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisY(valueaxis, series); - chart->setAxisX(barcategory, series); - - return chart; - } -}; - -class BarCategoryAxisXTitle: public BarCategoryAxisX -{ - QString name() { return "AxisX Title"; } - QChart *createChart(const DataTable &table) - { - QChart *chart = BarCategoryAxisX::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle(" BarCateogry X , Value Y, title"); - return chart; - } -}; - -DECLARE_CHART(BarCategoryAxisX); -DECLARE_CHART(BarCategoryAxisXTitle); diff --git a/demos/chartviewer/charts/axis/barcategoryaxisxlogy.cpp b/demos/chartviewer/charts/axis/barcategoryaxisxlogy.cpp deleted file mode 100644 index bd656543..00000000 --- a/demos/chartviewer/charts/axis/barcategoryaxisxlogy.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarCategoryAxisXLogY: public Chart -{ -public: - QString name() { return "AxisX"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "BarCategoryAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle(" BarCateogry X , LogValue Y"); - - QString name("Series "); - QBarSeries *series = new QBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisY(logvalueaxis, series); - chart->setAxisX(barcategory, series); - - return chart; - } -}; - -class BarCategoryAxisXLogYTitle: public BarCategoryAxisXLogY -{ - QString name() { return "AxisX Title"; } - QChart *createChart(const DataTable &table) - { - QChart *chart = BarCategoryAxisXLogY::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle(" BarCateogry X , LogValue Y, title"); - return chart; - } -}; - -DECLARE_CHART(BarCategoryAxisXLogY); -DECLARE_CHART(BarCategoryAxisXLogYTitle); diff --git a/demos/chartviewer/charts/axis/barcategoryaxisy.cpp b/demos/chartviewer/charts/axis/barcategoryaxisy.cpp deleted file mode 100644 index ad1859c0..00000000 --- a/demos/chartviewer/charts/axis/barcategoryaxisy.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalbarseries.h" -#include "qbarset.h" -#include "qvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarCategoryAxisY: public Chart -{ -public: - QString name() { return "AxisY"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "BarCategoryAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle(" BarCateogry Y , Value X"); - - QString name("Series "); - QHorizontalBarSeries *series = new QHorizontalBarSeries(chart); - QValueAxis *valueaxis = new QValueAxis(); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach(Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisX(valueaxis, series); - chart->setAxisY(barcategory, series); - - return chart; - } -}; - -class BarCategoryAxisYTitle: public BarCategoryAxisY -{ -public: - QString name() - { - return "AxisY Title"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = BarCategoryAxisY::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle(" BarCateogry Y , Value X, title"); - return chart; - } -}; - -DECLARE_CHART(BarCategoryAxisY); -DECLARE_CHART(BarCategoryAxisYTitle); diff --git a/demos/chartviewer/charts/axis/barcategoryaxisylogx.cpp b/demos/chartviewer/charts/axis/barcategoryaxisylogx.cpp deleted file mode 100644 index 3b76b469..00000000 --- a/demos/chartviewer/charts/axis/barcategoryaxisylogx.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarCategoryAxisYLogX: public Chart -{ -public: - QString name() { return "AxisY"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "BarCategoryAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle(" LogValue X , BarCateogry Y"); - - QString name("Series "); - QHorizontalBarSeries *series = new QHorizontalBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisX(logvalueaxis, series); - chart->setAxisY(barcategory, series); - - return chart; - } -}; - -class BarCategoryAxisYLogXTitle: public BarCategoryAxisYLogX -{ - QString name() { return "AxisX Title"; } - QChart *createChart(const DataTable &table) - { - QChart *chart = BarCategoryAxisYLogX::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle(" LogValue X , BarCateogry Y, title"); - return chart; - } -}; - -DECLARE_CHART(BarCategoryAxisYLogX); -DECLARE_CHART(BarCategoryAxisYLogXTitle); diff --git a/demos/chartviewer/charts/axis/categoryaxis.cpp b/demos/chartviewer/charts/axis/categoryaxis.cpp deleted file mode 100644 index 68997225..00000000 --- a/demos/chartviewer/charts/axis/categoryaxis.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include <QCategoryAxis> - -class CategoryLineChart: public Chart -{ -public: - QString name() { return QObject::tr("CategoryAxis"); } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Category X , Category Y "); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QCategoryAxis *axisX = new QCategoryAxis; - axisX->append("low", 5); - axisX->append("avg.", 12); - axisX->append("high", 19); - axisX->setRange(0, 20); - chart->setAxisX(axisX, chart->series().at(0)); - - QCategoryAxis *axisY = new QCategoryAxis; - axisY->append("cheap", 5); - axisY->append("fair", 12); - axisY->append("pricy", 20); - axisY->setRange(0, 20); - chart->setAxisY(axisY, chart->series().at(0)); - - return chart; - } -}; - -class CategoryLineChartTitle: public CategoryLineChart -{ -public: - QString name() { return QObject::tr("CategoryAxis, Title"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = CategoryLineChart::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("Category X , Category Y,title "); - return chart; - } -}; - -DECLARE_CHART(CategoryLineChart) -DECLARE_CHART(CategoryLineChartTitle) diff --git a/demos/chartviewer/charts/axis/datetimeaxisx.cpp b/demos/chartviewer/charts/axis/datetimeaxisx.cpp deleted file mode 100644 index 2306467e..00000000 --- a/demos/chartviewer/charts/axis/datetimeaxisx.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qdatetimeaxis.h" - -class DateTimeAxisX: public Chart -{ -public: - QString name() { return "AxisX"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "DateTimeAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("DateTime X , Value Y"); - QValueAxis *valueaxis = new QValueAxis(); - QDateTimeAxis *datetimeaxis = new QDateTimeAxis(); - datetimeaxis->setTickCount(10); - datetimeaxis->setFormat("yyyy"); - - qreal day = 1000l * 60l * 60l * 24l; - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) { - QPointF point = data.first; - series->append(day * 365l * 30l + point.x() * day * 365l, point.y()); - } - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - chart->setAxisX(datetimeaxis, series); - chart->setAxisY(valueaxis, series); - } - - return chart; - } -}; - -class DateTimeAxisXTitle: public DateTimeAxisX -{ -public: - QString name() { return "AxisX Title"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = DateTimeAxisX::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("DateTime X , Value Y, Title"); - return chart; - } -}; - - -DECLARE_CHART(DateTimeAxisX); -DECLARE_CHART(DateTimeAxisXTitle); diff --git a/demos/chartviewer/charts/axis/datetimeaxisy.cpp b/demos/chartviewer/charts/axis/datetimeaxisy.cpp deleted file mode 100644 index 04d1fee3..00000000 --- a/demos/chartviewer/charts/axis/datetimeaxisy.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qdatetimeaxis.h" - -class DateTimeAxisY: public Chart -{ -public: - QString name() { return "AxisY"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return "DateTimeAxis"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Value X , DateTime Y"); - QValueAxis *valueaxis = new QValueAxis(); - QDateTimeAxis *datetimeaxis = new QDateTimeAxis(); - datetimeaxis->setTickCount(10); - datetimeaxis->setFormat("yyyy"); - - qreal day = 1000l * 60l * 60l * 24l; - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) { - QPointF point = data.first; - series->append(point.x(), day * 365l * 30l + point.y() * day * 365l); - } - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - chart->setAxisY(datetimeaxis, series); - chart->setAxisX(valueaxis, series); - } - - return chart; - } -}; - -class DateTimeAxisYTitle: public DateTimeAxisY -{ -public: - QString name() { return "AxisY Title"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = DateTimeAxisY::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("Value X , DateTime Y, Title"); - return chart; - } -}; - -DECLARE_CHART(DateTimeAxisY); -DECLARE_CHART(DateTimeAxisYTitle); diff --git a/demos/chartviewer/charts/axis/logvalueaxisx.cpp b/demos/chartviewer/charts/axis/logvalueaxisx.cpp deleted file mode 100644 index ec59df87..00000000 --- a/demos/chartviewer/charts/axis/logvalueaxisx.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qlogvalueaxis.h" -#include "qcategoryaxis.h" - -class LogValueAxisX: public Chart -{ -public: - QString name() { return "LogValueAxisX"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return QObject::tr("Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("LogValue X , Value Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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(); - QLogValueAxis *axis = new QLogValueAxis(); - axis->setBase(1.2); - foreach (QAbstractSeries *series, chart->series()) - chart->setAxisX(axis, series); - - return chart; - } -}; - -class LogValueAxisTitleX: public LogValueAxisX -{ -public: - QString name() { return "LogValueAxisXTitle"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = LogValueAxisX::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("Log Value X , Value Y, title"); - return chart; - } -}; - -DECLARE_CHART(LogValueAxisX); -DECLARE_CHART(LogValueAxisTitleX); diff --git a/demos/chartviewer/charts/axis/logvalueaxisy.cpp b/demos/chartviewer/charts/axis/logvalueaxisy.cpp deleted file mode 100644 index a4344886..00000000 --- a/demos/chartviewer/charts/axis/logvalueaxisy.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qlogvalueaxis.h" -#include "qcategoryaxis.h" - -class LogValueAxisY: public Chart -{ -public: - QString name() { return "LogValueAxisY"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return QObject::tr("Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Value X , LogValue Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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(); - QLogValueAxis *axis = new QLogValueAxis(); - axis->setBase(2); - foreach (QAbstractSeries *series, chart->series()) - chart->setAxisY(axis, series); - - return chart; - } -}; - -class LogValueAxisTitleY: public LogValueAxisY -{ -public: - QString name() { return "LogValueAxisYTitle"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = LogValueAxisY::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("Value X , Log Value Y, title"); - return chart; - } -}; - -DECLARE_CHART(LogValueAxisY); -DECLARE_CHART(LogValueAxisTitleY); diff --git a/demos/chartviewer/charts/axis/valueaxis.cpp b/demos/chartviewer/charts/axis/valueaxis.cpp deleted file mode 100644 index b37608cd..00000000 --- a/demos/chartviewer/charts/axis/valueaxis.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" - -class ValueAxis: public Chart -{ -public: - QString name() { return "ValueAxis"; } - QString category() { return QObject::tr("Axis"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Value X , Value Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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(); - QValueAxis *axis = new QValueAxis(); - foreach (QAbstractSeries *series, chart->series()) - chart->setAxisX(axis, series); - - return chart; - } -}; - -class ValueAxisTitle: public ValueAxis -{ -public: - QString name() { return "ValueAxis Title"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = ValueAxis::createChart(table); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->setTitle("Value X , Value Y, title"); - return chart; - } -}; - -DECLARE_CHART(ValueAxis); -DECLARE_CHART(ValueAxisTitle); diff --git a/demos/chartviewer/charts/barseries/horizontalbarchart.cpp b/demos/chartviewer/charts/barseries/horizontalbarchart.cpp deleted file mode 100644 index f03eb23d..00000000 --- a/demos/chartviewer/charts/barseries/horizontalbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalbarseries.h" -#include "qbarset.h" - -class HorizontalBarChart: public Chart -{ -public: - QString name() { return QObject::tr("HorizontalBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Horizontal"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Horizontal bar chart"); - QHorizontalBarSeries *series = new QHorizontalBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(HorizontalBarChart) - diff --git a/demos/chartviewer/charts/barseries/horizontalpercentbarchart.cpp b/demos/chartviewer/charts/barseries/horizontalpercentbarchart.cpp deleted file mode 100644 index cc719209..00000000 --- a/demos/chartviewer/charts/barseries/horizontalpercentbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalpercentbarseries.h" -#include "qbarset.h" - -class HorizontalPercentBarChart: public Chart -{ -public: - QString name() { return QObject::tr("HorizontalPercentBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Horizontal"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Horizontal percent chart"); - QHorizontalPercentBarSeries *series = new QHorizontalPercentBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(HorizontalPercentBarChart) - diff --git a/demos/chartviewer/charts/barseries/horizontalstackedbarchart.cpp b/demos/chartviewer/charts/barseries/horizontalstackedbarchart.cpp deleted file mode 100644 index ab2c49d2..00000000 --- a/demos/chartviewer/charts/barseries/horizontalstackedbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalstackedbarseries.h" -#include "qbarset.h" - -class HorizontalStackedBarChart: public Chart -{ -public: - QString name() { return QObject::tr("HorizontalStackedBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Horizontal"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Horizontal stacked chart"); - QHorizontalStackedBarSeries *series = new QHorizontalStackedBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(HorizontalStackedBarChart) - diff --git a/demos/chartviewer/charts/barseries/verticalbarchart.cpp b/demos/chartviewer/charts/barseries/verticalbarchart.cpp deleted file mode 100644 index 6f48d7b4..00000000 --- a/demos/chartviewer/charts/barseries/verticalbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qbarseries.h" -#include "qbarset.h" - -class VerticalBarChart: public Chart -{ -public: - QString name() { return QObject::tr("VerticalBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Vertical"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Vertical bar chart"); - QBarSeries *series = new QBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(VerticalBarChart) - diff --git a/demos/chartviewer/charts/barseries/verticalpercentbarchart.cpp b/demos/chartviewer/charts/barseries/verticalpercentbarchart.cpp deleted file mode 100644 index a2710b09..00000000 --- a/demos/chartviewer/charts/barseries/verticalpercentbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qpercentbarseries.h" -#include "qbarset.h" - -class VerticalPercentBarChart: public Chart -{ -public: - QString name() { return QObject::tr("VerticalPercentBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Vertical"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Percent bar chart"); - QPercentBarSeries *series = new QPercentBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(VerticalPercentBarChart) - diff --git a/demos/chartviewer/charts/barseries/verticalstackedbarchart.cpp b/demos/chartviewer/charts/barseries/verticalstackedbarchart.cpp deleted file mode 100644 index 21160edc..00000000 --- a/demos/chartviewer/charts/barseries/verticalstackedbarchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qstackedbarseries.h" -#include "qbarset.h" - -class VerticalStackedBarChart: public Chart -{ -public: - QString name() { return QObject::tr("VerticalStackedBarChart"); } - QString category() { return QObject::tr("BarSeries"); } - QString subCategory() { return QObject::tr("Vertical"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Stacked bar chart"); - QStackedBarSeries *series = new QStackedBarSeries(chart); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(VerticalStackedBarChart) - diff --git a/demos/chartviewer/charts/charts.pri b/demos/chartviewer/charts/charts.pri deleted file mode 100644 index 5bef427f..00000000 --- a/demos/chartviewer/charts/charts.pri +++ /dev/null @@ -1,51 +0,0 @@ -INCLUDEPATH += $$PWD -DEPENDPATH += $$PWD -SOURCES += \ - $$PWD/font/font.cpp \ - $$PWD/xyseries/linechart.cpp \ - $$PWD/xyseries/scatterchart.cpp \ - $$PWD/xyseries/splinechart.cpp \ - $$PWD/xyseries/areachart.cpp \ - $$PWD/barseries/verticalstackedbarchart.cpp \ - $$PWD/barseries/horizontalstackedbarchart.cpp \ - $$PWD/barseries/verticalbarchart.cpp \ - $$PWD/barseries/horizontalbarchart.cpp \ - $$PWD/barseries/horizontalpercentbarchart.cpp \ - $$PWD/barseries/verticalpercentbarchart.cpp \ - $$PWD/pieseries/piechart.cpp \ - $$PWD/pieseries/donutchart.cpp \ - $$PWD/axis/valueaxis.cpp \ - $$PWD/axis/logvalueaxisx.cpp \ - $$PWD/axis/logvalueaxisy.cpp \ - $$PWD/axis/categoryaxis.cpp \ - $$PWD/axis/barcategoryaxisx.cpp \ - $$PWD/axis/barcategoryaxisy.cpp \ - $$PWD/axis/barcategoryaxisxlogy.cpp \ - $$PWD/axis/barcategoryaxisylogx.cpp \ - $$PWD/multiaxis/multivalueaxis.cpp \ - $$PWD/multiaxis/multivalueaxis2.cpp \ - $$PWD/multiaxis/multivalueaxis3.cpp \ - $$PWD/multiaxis/multivalueaxis4.cpp \ - $$PWD/multiaxis/multivaluebaraxis.cpp \ - $$PWD/size/sizecharts.cpp \ - $$PWD/domain/barlogy.cpp \ - $$PWD/domain/barlogx.cpp \ - $$PWD/domain/barstackedlogy.cpp \ - $$PWD/domain/barstackedlogx.cpp \ - $$PWD/domain/barpercentlogy.cpp \ - $$PWD/domain/barpercentlogx.cpp \ - $$PWD/domain/linelogxlogy.cpp \ - $$PWD/domain/linelogxy.cpp \ - $$PWD/domain/linexlogy.cpp \ - $$PWD/domain/splinelogxlogy.cpp \ - $$PWD/domain/splinelogxy.cpp \ - $$PWD/domain/splinexlogy.cpp \ - $$PWD/domain/scatterlogxlogy.cpp \ - $$PWD/domain/scatterlogxy.cpp \ - $$PWD/domain/scatterxlogy.cpp - -!linux-arm*: { -SOURCES += \ - $$PWD/axis/datetimeaxisx.cpp \ - $$PWD/axis/datetimeaxisy.cpp -} diff --git a/demos/chartviewer/charts/domain/barlogx.cpp b/demos/chartviewer/charts/domain/barlogx.cpp deleted file mode 100644 index efb4c2cb..00000000 --- a/demos/chartviewer/charts/domain/barlogx.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarLogX: public Chart -{ -public: - QString name() { return "Horizontal Bar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Horizontal Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Bar: Log X, BarCateogry Y"); - - QString name("Series "); - QHorizontalBarSeries *series = new QHorizontalBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisX(logvalueaxis, series); - chart->setAxisY(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarLogX); diff --git a/demos/chartviewer/charts/domain/barlogy.cpp b/demos/chartviewer/charts/domain/barlogy.cpp deleted file mode 100644 index a8d01a74..00000000 --- a/demos/chartviewer/charts/domain/barlogy.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarLogY: public Chart -{ -public: - QString name() { return "Bar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Vertical Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Bar: BarCateogry X, Log Y"); - - QString name("Series "); - QBarSeries *series = new QBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisY(logvalueaxis, series); - chart->setAxisX(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarLogY); diff --git a/demos/chartviewer/charts/domain/barpercentlogx.cpp b/demos/chartviewer/charts/domain/barpercentlogx.cpp deleted file mode 100644 index 9bcf2490..00000000 --- a/demos/chartviewer/charts/domain/barpercentlogx.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalpercentbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarPercentLogX: public Chart -{ -public: - QString name() { return "Horizontal PercentBar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Horizontal Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("PercentBar: Log X, BarCateogry Y"); - - QString name("Series "); - QHorizontalPercentBarSeries *series = new QHorizontalPercentBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisX(logvalueaxis, series); - chart->setAxisY(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarPercentLogX); diff --git a/demos/chartviewer/charts/domain/barpercentlogy.cpp b/demos/chartviewer/charts/domain/barpercentlogy.cpp deleted file mode 100644 index f771369b..00000000 --- a/demos/chartviewer/charts/domain/barpercentlogy.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qpercentbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarPercentLogY: public Chart -{ -public: - QString name() { return "PercentBar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Vertical Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("PercentBar: BarCateogry X, Log Y"); - - QString name("Series "); - QPercentBarSeries *series = new QPercentBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisY(logvalueaxis, series); - chart->setAxisX(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarPercentLogY); diff --git a/demos/chartviewer/charts/domain/barstackedlogx.cpp b/demos/chartviewer/charts/domain/barstackedlogx.cpp deleted file mode 100644 index fff7dbc3..00000000 --- a/demos/chartviewer/charts/domain/barstackedlogx.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qhorizontalstackedbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarStackedLogX: public Chart -{ -public: - QString name() { return "Horizontal StackedBar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Horizontal Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("StackedBar: Log X, BarCateogry Y"); - - QString name("Series "); - QHorizontalStackedBarSeries *series = new QHorizontalStackedBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisX(logvalueaxis, series); - chart->setAxisY(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarStackedLogX); diff --git a/demos/chartviewer/charts/domain/barstackedlogy.cpp b/demos/chartviewer/charts/domain/barstackedlogy.cpp deleted file mode 100644 index d5041182..00000000 --- a/demos/chartviewer/charts/domain/barstackedlogy.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qstackedbarseries.h" -#include "qbarset.h" -#include "qlogvalueaxis.h" -#include "qbarcategoryaxis.h" - -class BarStackedLogY: public Chart -{ -public: - QString name() { return "StackedBar"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return "Vertical Log"; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("StackedBar: BarCateogry X, Log Y"); - - QString name("Series "); - QStackedBarSeries *series = new QStackedBarSeries(chart); - QLogValueAxis *logvalueaxis = new QLogValueAxis(); - logvalueaxis->setBase(2); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - for (int i(0); i < table.count(); i++) { - QBarSet *set = new QBarSet("Bar set " + QString::number(i)); - foreach (Data data, table[i]) - *set << data.first.y(); - series->append(set); - } - chart->addSeries(series); - - int count = series->barSets().first()->count(); - - - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - - chart->setAxisY(logvalueaxis, series); - chart->setAxisX(barcategory, series); - - return chart; - } -}; - -DECLARE_CHART(BarStackedLogY); diff --git a/demos/chartviewer/charts/domain/linelogxlogy.cpp b/demos/chartviewer/charts/domain/linelogxlogy.cpp deleted file mode 100644 index 3180baf4..00000000 --- a/demos/chartviewer/charts/domain/linelogxlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qlogvalueaxis.h" - -class LineLogXLogY: public Chart -{ -public: - QString name() { return "Line LogX LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Line: Log X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(LineLogXLogY); diff --git a/demos/chartviewer/charts/domain/linelogxy.cpp b/demos/chartviewer/charts/domain/linelogxy.cpp deleted file mode 100644 index 7dbffc75..00000000 --- a/demos/chartviewer/charts/domain/linelogxy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class LineLogXY: public Chart -{ -public: - QString name() { return "Line LogX Y"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Line: Log X, Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QValueAxis *axisY= new QValueAxis(); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(LineLogXY); diff --git a/demos/chartviewer/charts/domain/linexlogy.cpp b/demos/chartviewer/charts/domain/linexlogy.cpp deleted file mode 100644 index 468f71fa..00000000 --- a/demos/chartviewer/charts/domain/linexlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class LineXLogY: public Chart -{ -public: - QString name() { return "Line X LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Line: X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QValueAxis *axisX= new QValueAxis(); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(LineXLogY); diff --git a/demos/chartviewer/charts/domain/scatterlogxlogy.cpp b/demos/chartviewer/charts/domain/scatterlogxlogy.cpp deleted file mode 100644 index 5b126902..00000000 --- a/demos/chartviewer/charts/domain/scatterlogxlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qscatterseries.h" -#include "qlogvalueaxis.h" - -class ScatterLogXLogY: public Chart -{ -public: - QString name() { return "Scatter LogX LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Scatter: Log X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QScatterSeries *series = new QScatterSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(ScatterLogXLogY); diff --git a/demos/chartviewer/charts/domain/scatterlogxy.cpp b/demos/chartviewer/charts/domain/scatterlogxy.cpp deleted file mode 100644 index 7fcb9f52..00000000 --- a/demos/chartviewer/charts/domain/scatterlogxy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qscatterseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class ScatterLogXY: public Chart -{ -public: - QString name() { return "Scatter LogX Y"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Scatter: Log X, Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QScatterSeries *series = new QScatterSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QValueAxis *axisY= new QValueAxis(); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(ScatterLogXY); diff --git a/demos/chartviewer/charts/domain/scatterxlogy.cpp b/demos/chartviewer/charts/domain/scatterxlogy.cpp deleted file mode 100644 index c05a8874..00000000 --- a/demos/chartviewer/charts/domain/scatterxlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qscatterseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class ScatterXLogY: public Chart -{ -public: - QString name() { return "Scatter X LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Scatter: X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QScatterSeries *series = new QScatterSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QValueAxis *axisX= new QValueAxis(); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(ScatterXLogY); diff --git a/demos/chartviewer/charts/domain/splinelogxlogy.cpp b/demos/chartviewer/charts/domain/splinelogxlogy.cpp deleted file mode 100644 index 8f4b8049..00000000 --- a/demos/chartviewer/charts/domain/splinelogxlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qsplineseries.h" -#include "qlogvalueaxis.h" - -class SplineLogXLogY: public Chart -{ -public: - QString name() { return "Spline LogX LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Spline: Log X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QSplineSeries *series = new QSplineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(SplineLogXLogY); diff --git a/demos/chartviewer/charts/domain/splinelogxy.cpp b/demos/chartviewer/charts/domain/splinelogxy.cpp deleted file mode 100644 index 6f6a823c..00000000 --- a/demos/chartviewer/charts/domain/splinelogxy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qsplineseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class SplineLogXY: public Chart -{ -public: - QString name() { return "Spline LogX Y"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Spline: Log X, Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QSplineSeries *series = new QSplineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QLogValueAxis *axisX= new QLogValueAxis(); - axisX->setBase(2); - QValueAxis *axisY= new QValueAxis(); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(SplineLogXY); diff --git a/demos/chartviewer/charts/domain/splinexlogy.cpp b/demos/chartviewer/charts/domain/splinexlogy.cpp deleted file mode 100644 index e1eaf4ca..00000000 --- a/demos/chartviewer/charts/domain/splinexlogy.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qsplineseries.h" -#include "qlogvalueaxis.h" -#include "qvalueaxis.h" - -class SplineXLogY: public Chart -{ -public: - QString name() { return "Spline X LogY"; } - QString category() { return QObject::tr("Domain"); } - QString subCategory() { return QObject::tr("Both Log"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Spline: X, Log Y"); - - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - QSplineSeries *series = new QSplineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - - QValueAxis *axisX= new QValueAxis(); - QLogValueAxis *axisY= new QLogValueAxis(); - axisY->setBase(2); - foreach (QAbstractSeries *series, chart->series()) { - chart->setAxisX(axisX, series); - chart->setAxisY(axisY, series); - } - - return chart; - } -}; - -DECLARE_CHART(SplineXLogY); diff --git a/demos/chartviewer/charts/font/font.cpp b/demos/chartviewer/charts/font/font.cpp deleted file mode 100644 index d8a100fc..00000000 --- a/demos/chartviewer/charts/font/font.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" - -class FontChart: public Chart -{ -public: - FontChart(int fontSize): m_fontSize(fontSize) {}; - QString name() { return QObject::tr("Font") + " " + QString::number(m_fontSize); } - QString category() { return QObject::tr("Font"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Font size " + QString::number(m_fontSize)); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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(); - QFont font; - font.setPixelSize(m_fontSize); - chart->setTitleFont(font); - chart->axisX()->setLabelsFont(font); - chart->axisY()->setLabelsFont(font); - chart->axisX()->setTitleText("Axis X"); - chart->axisY()->setTitleText("Axis Y"); - chart->axisX()->setTitleFont(font); - chart->axisY()->setTitleFont(font); - return chart; - } - -private: - int m_fontSize; -}; - -class FontChart6: public FontChart -{ -public: - FontChart6(): FontChart(6) {}; -}; - -class FontChart8: public FontChart -{ -public: - FontChart8(): FontChart(8) {}; -}; - -class FontChart10: public FontChart -{ -public: - FontChart10(): FontChart(10) {}; -}; - -class FontChart14: public FontChart -{ -public: - FontChart14(): FontChart(14) {}; -}; - -class FontChart18: public FontChart -{ -public: - FontChart18(): FontChart(18) {}; -}; - -class FontChart20: public FontChart -{ -public: - FontChart20(): FontChart(20) {}; -}; - -class FontChart24: public FontChart -{ -public: - FontChart24(): FontChart(24) {}; -}; - -class FontChart28: public FontChart -{ -public: - FontChart28(): FontChart(28) {}; -}; - -class FontChart32: public FontChart -{ -public: - FontChart32(): FontChart(32) {}; -}; - -DECLARE_CHART(FontChart6); -DECLARE_CHART(FontChart8); -DECLARE_CHART(FontChart10); -DECLARE_CHART(FontChart14); -DECLARE_CHART(FontChart18); -DECLARE_CHART(FontChart20); -DECLARE_CHART(FontChart24); -DECLARE_CHART(FontChart28); -DECLARE_CHART(FontChart32); diff --git a/demos/chartviewer/charts/multiaxis/multivalueaxis.cpp b/demos/chartviewer/charts/multiaxis/multivalueaxis.cpp deleted file mode 100644 index 6e5ead28..00000000 --- a/demos/chartviewer/charts/multiaxis/multivalueaxis.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" - -class MultiValueAxis: public Chart -{ -public: - QString name() - { - return "AxisSet 1"; - } - QString category() - { - return QObject::tr("MultiAxis"); - } - QString subCategory() - { - return "MultiValueAxis"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - QValueAxis *axisX; - QValueAxis *axisY; - - chart->setTitle("MultiValueAxis1"); - - QString name("Series"); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - - chart->addSeries(series); - axisX = new QValueAxis(); - axisX->setLinePenColor(series->pen().color()); - axisY = new QValueAxis(); - axisY->setLinePenColor(series->pen().color()); - - chart->addAxis(axisX,nameIndex % 2?Qt::AlignTop:Qt::AlignBottom); - chart->addAxis(axisY,nameIndex % 2?Qt::AlignRight:Qt::AlignLeft); - series->attachAxis(axisX); - series->attachAxis(axisY); - - nameIndex++; - } - - return chart; - } -}; - -DECLARE_CHART(MultiValueAxis); diff --git a/demos/chartviewer/charts/multiaxis/multivalueaxis2.cpp b/demos/chartviewer/charts/multiaxis/multivalueaxis2.cpp deleted file mode 100644 index 16c55d4b..00000000 --- a/demos/chartviewer/charts/multiaxis/multivalueaxis2.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" - -class MultiValueAxis2: public Chart -{ -public: - QString name() - { - return "AxisSet 2"; - } - QString category() - { - return QObject::tr("MultiAxis"); - } - QString subCategory() - { - return "MultiValueAxis"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - QValueAxis *axisX; - QValueAxis *axisY; - - chart->setTitle("MultiValueAxis2"); - - QString name("Series"); - int nameIndex = 1; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - - chart->addSeries(series); - axisX = new QValueAxis(); - axisX->setLinePenColor(series->pen().color()); - - axisY = new QValueAxis(); - axisY->setLinePenColor(series->pen().color()); - - chart->addAxis(axisX, nameIndex % 2?Qt::AlignTop:Qt::AlignBottom); - chart->addAxis(axisY, nameIndex % 2?Qt::AlignRight:Qt::AlignLeft); - series->attachAxis(axisX); - series->attachAxis(axisY); - nameIndex++; - } - - return chart; - } -}; - -DECLARE_CHART(MultiValueAxis2); diff --git a/demos/chartviewer/charts/multiaxis/multivalueaxis3.cpp b/demos/chartviewer/charts/multiaxis/multivalueaxis3.cpp deleted file mode 100644 index b4cd80dd..00000000 --- a/demos/chartviewer/charts/multiaxis/multivalueaxis3.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" - -class MultiValueAxis3: public Chart -{ -public: - QString name() - { - return "AxisSet 3"; - } - QString category() - { - return QObject::tr("MultiAxis"); - } - QString subCategory() - { - return "MultiValueAxis"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - QValueAxis *axisX; - QValueAxis *axisY; - - chart->setTitle("MultiValueAxis3"); - - QString name("Series"); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - - chart->addSeries(series); - axisX = new QValueAxis(); - axisX->setLinePenColor(series->pen().color()); - axisX->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - - axisY = new QValueAxis(); - axisY->setLinePenColor(series->pen().color()); - axisY->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - - chart->addAxis(axisX, nameIndex % 2?Qt::AlignTop:Qt::AlignBottom); - chart->addAxis(axisY, nameIndex % 2?Qt::AlignRight:Qt::AlignLeft); - series->attachAxis(axisX); - series->attachAxis(axisY); - nameIndex++; - } - - return chart; - } -}; - -DECLARE_CHART(MultiValueAxis3); diff --git a/demos/chartviewer/charts/multiaxis/multivalueaxis4.cpp b/demos/chartviewer/charts/multiaxis/multivalueaxis4.cpp deleted file mode 100644 index c35370c7..00000000 --- a/demos/chartviewer/charts/multiaxis/multivalueaxis4.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" - -class MultiValueAxis4: public Chart -{ -public: - QString name() - { - return "AxisSet 4"; - } - QString category() - { - return QObject::tr("MultiAxis"); - } - QString subCategory() - { - return "MultiValueAxis"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - QValueAxis *axisX; - QValueAxis *axisY; - - chart->setTitle("MultiValueAxis4"); - - QString name("Series"); - int nameIndex = 1; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - - chart->addSeries(series); - axisX = new QValueAxis(); - axisX->setLinePenColor(series->pen().color()); - axisX->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - axisY = new QValueAxis(); - axisY->setLinePenColor(series->pen().color()); - axisY->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - - chart->addAxis(axisX, nameIndex % 2?Qt::AlignTop:Qt::AlignBottom); - chart->addAxis(axisY, nameIndex % 2?Qt::AlignRight:Qt::AlignLeft); - series->attachAxis(axisX); - series->attachAxis(axisY); - nameIndex++; - } - - return chart; - } -}; - -DECLARE_CHART(MultiValueAxis4); diff --git a/demos/chartviewer/charts/multiaxis/multivaluebaraxis.cpp b/demos/chartviewer/charts/multiaxis/multivaluebaraxis.cpp deleted file mode 100644 index 09bfba11..00000000 --- a/demos/chartviewer/charts/multiaxis/multivaluebaraxis.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" -#include "qcategoryaxis.h" -#include "qbarseries.h" -#include "qbarset.h" -#include "qbarcategoryaxis.h" - -class MultiValueBarAxis: public Chart -{ -public: - QString name() - { - return "Axis"; - } - QString category() - { - return QObject::tr("MultiAxis"); - } - QString subCategory() - { - return "MultiBarAxis"; - } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - QValueAxis *axisX; - QValueAxis *axisY; - QBarSeries *series = new QBarSeries(); - QBarCategoryAxis *barcategory = new QBarCategoryAxis(); - - chart->setTitle("MultiBarAxis"); - - QString name("Series"); - int nameIndex = 1; - for (int i(0); i < 2; i++) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, table.at(i)) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - - chart->addSeries(series); - axisX = new QValueAxis(); - axisX->setLinePenColor(series->pen().color()); - axisX->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - - axisY = new QValueAxis(); - axisY->setLinePenColor(series->pen().color()); - axisY->setTitleText("ValueAxis for series" + QString::number(nameIndex)); - - chart->addAxis(axisX, nameIndex % 2?Qt::AlignTop:Qt::AlignBottom); - chart->addAxis(axisY, nameIndex % 2?Qt::AlignRight:Qt::AlignLeft); - series->attachAxis(axisX); - series->attachAxis(axisY); - nameIndex++; - } - - QBarSet *set = new QBarSet("Bar set "); - foreach (Data data, table.at(2)) - *set << data.first.y(); - - int count = set->count(); - for (int i = 0; i < count; i++) { - barcategory->append("BarSet " + QString::number(i)); - } - series->append(set); - chart->addSeries(series); - - barcategory->setLinePen(set->brush().color()); - barcategory->setGridLinePen(set->brush().color()); - barcategory->setTitleText("BarCategoryAxis Title"); - - chart->setAxisX(barcategory, series); - - return chart; - } -}; - - -DECLARE_CHART(MultiValueBarAxis); diff --git a/demos/chartviewer/charts/pieseries/donutchart.cpp b/demos/chartviewer/charts/pieseries/donutchart.cpp deleted file mode 100644 index 1731930d..00000000 --- a/demos/chartviewer/charts/pieseries/donutchart.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qpieseries.h" - -class DonutChart: public Chart -{ -public: - QString name() { return QObject::tr("DonutChart"); } - QString category() { return QObject::tr("PieSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Donut chart"); - for (int i = 0, j = table.count(); i < table.count(); i++, j--) { - QPieSeries *series = new QPieSeries(chart); - foreach (Data data, table[i]) { - QPieSlice *slice = series->append(data.second, data.first.y()); - if (data == table[i].first()) - slice->setLabelVisible(); - } - series->setPieSize(j / (qreal) table.count()); - if (j > 1) - series->setHoleSize((j - 1) / (qreal) table.count() + 0.1); - series->setHorizontalPosition(0.5); - series->setVerticalPosition(0.5); - chart->addSeries(series); - } - return chart; - } -}; - -DECLARE_CHART(DonutChart) - diff --git a/demos/chartviewer/charts/pieseries/piechart.cpp b/demos/chartviewer/charts/pieseries/piechart.cpp deleted file mode 100644 index cde41830..00000000 --- a/demos/chartviewer/charts/pieseries/piechart.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qpieseries.h" - -class PieChart: public Chart -{ -public: - QString name() { return QObject::tr("PieChart"); } - QString category() { return QObject::tr("PieSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Pie chart"); - qreal pieSize = 1.0 / table.count(); - for (int i = 0; i < table.count(); i++) { - QPieSeries *series = new QPieSeries(chart); - foreach (Data data, table[i]) { - QPieSlice *slice = series->append(data.second, data.first.y()); - if (data == table[i].first()) { - slice->setLabelVisible(); - slice->setExploded(); - } - } - qreal hPos = (pieSize / 2) + (i / (qreal) table.count()); - series->setPieSize(pieSize); - series->setHorizontalPosition(hPos); - series->setVerticalPosition(0.5); - chart->addSeries(series); - } - return chart; - } -}; - -DECLARE_CHART(PieChart) - diff --git a/demos/chartviewer/charts/size/sizecharts.cpp b/demos/chartviewer/charts/size/sizecharts.cpp deleted file mode 100644 index 5f1ab378..00000000 --- a/demos/chartviewer/charts/size/sizecharts.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" -#include "qvalueaxis.h" - -class SizeChart: public Chart -{ -public: - QString name() { return QObject::tr("PlotArea"); } - QString category() { return QObject::tr("Size"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - - QChart *chart = new QChart(); - QString name("Series"); - int nameIndex = 0; - foreach (DataList list, table) { - QLineSeries *series = new QLineSeries(chart); - foreach (Data data, list) - series->append(data.first); - series->setName(name + QString::number(nameIndex)); - nameIndex++; - chart->addSeries(series); - } - chart->setContentsMargins(0,0,0,0); - chart->setMargins(QMargins(0,0,0,0)); - return chart; - } -}; - -class SizeChart2: public SizeChart -{ -public: - QString name() { return QObject::tr("PA + T"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart::createChart(table); - chart->setTitle(name()); - return chart; - } -}; - -class SizeChart3: public SizeChart2 -{ -public: - QString name() { return QObject::tr("PA+T+CM10"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart2::createChart(table); - chart->setContentsMargins(10,10,10,10); - - return chart; - } -}; - -class SizeChart4: public SizeChart3 -{ -public: - QString name() { return QObject::tr("PA+T+CM10+M25"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart3::createChart(table); - chart->setMargins(QMargins(30,30,30,30)); - return chart; - } -}; - -class SizeChart5: public SizeChart4 -{ -public: - QString name() { return QObject::tr("PA+T+CM10+M25+AX"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart4::createChart(table); - chart->createDefaultAxes(); - chart->axisY()->hide(); - return chart; - } -}; - -class SizeChart6: public SizeChart4 -{ -public: - QString name() { return QObject::tr("PA+T+CM10+M25+AY"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart4::createChart(table); - chart->createDefaultAxes(); - chart->axisX()->hide(); - return chart; - } -}; - -class SizeChart7: public SizeChart4 -{ -public: - QString name() { return QObject::tr("PA+T+CM10+M25+AX+AY"); } - - QChart *createChart(const DataTable &table) - { - QChart *chart = SizeChart4::createChart(table); - chart->createDefaultAxes(); - return chart; - } -}; - -DECLARE_CHART(SizeChart) -DECLARE_CHART(SizeChart2) -DECLARE_CHART(SizeChart3) -DECLARE_CHART(SizeChart4) -DECLARE_CHART(SizeChart5) -DECLARE_CHART(SizeChart6) -DECLARE_CHART(SizeChart7) diff --git a/demos/chartviewer/charts/xyseries/areachart.cpp b/demos/chartviewer/charts/xyseries/areachart.cpp deleted file mode 100644 index 70c9a9c8..00000000 --- a/demos/chartviewer/charts/xyseries/areachart.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qareaseries.h" -#include "qlineseries.h" - -class AreaChart: public Chart -{ -public: - QString name() { return QObject::tr("AreaChart"); } - QString category() { return QObject::tr("XYSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - 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 < table.count(); i++) { - QLineSeries *upperSeries = new QLineSeries(chart); - for (int j(0); j < table[i].count(); j++) { - Data data = table[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; - } -}; - -DECLARE_CHART(AreaChart) - diff --git a/demos/chartviewer/charts/xyseries/linechart.cpp b/demos/chartviewer/charts/xyseries/linechart.cpp deleted file mode 100644 index 0436ff66..00000000 --- a/demos/chartviewer/charts/xyseries/linechart.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qlineseries.h" - -class LineChart: public Chart -{ -public: - QString name() { return QObject::tr("LineChart"); } - QString category() { return QObject::tr("XYSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Line chart"); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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; - } -}; - -DECLARE_CHART(LineChart) - diff --git a/demos/chartviewer/charts/xyseries/scatterchart.cpp b/demos/chartviewer/charts/xyseries/scatterchart.cpp deleted file mode 100644 index 7a88191f..00000000 --- a/demos/chartviewer/charts/xyseries/scatterchart.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qscatterseries.h" - -class ScatterChart: public Chart -{ -public: - QString name() { return QObject::tr("ScatterChart"); } - QString category() { return QObject::tr("XYSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Scatter chart"); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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; - } -}; - -DECLARE_CHART(ScatterChart) diff --git a/demos/chartviewer/charts/xyseries/splinechart.cpp b/demos/chartviewer/charts/xyseries/splinechart.cpp deleted file mode 100644 index bf81ff29..00000000 --- a/demos/chartviewer/charts/xyseries/splinechart.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "charts.h" -#include "qchart.h" -#include "qsplineseries.h" - -class SplineChart: public Chart -{ -public: - QString name() { return QObject::tr("SplineChart"); } - QString category() { return QObject::tr("XYSeries"); } - QString subCategory() { return QString::null; } - - QChart *createChart(const DataTable &table) - { - QChart *chart = new QChart(); - chart->setTitle("Spline chart"); - QString name("Series "); - int nameIndex = 0; - foreach (DataList list, table) { - 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; - } -}; - -DECLARE_CHART(SplineChart) - diff --git a/demos/chartviewer/chartviewer.pro b/demos/chartviewer/chartviewer.pro deleted file mode 100644 index a816e4df..00000000 --- a/demos/chartviewer/chartviewer.pro +++ /dev/null @@ -1,8 +0,0 @@ -!include( ../demos.pri ):error( "Couldn't find the demos.pri file!" ) -include(charts/charts.pri) -TARGET = chartviewer -QT += opengl -INCLUDEPATH += . -SOURCES += main.cpp window.cpp view.cpp grid.cpp -HEADERS += window.h view.h charts.h model.h grid.h - diff --git a/demos/chartviewer/grid.cpp b/demos/chartviewer/grid.cpp deleted file mode 100644 index 3a2f8796..00000000 --- a/demos/chartviewer/grid.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "grid.h" -#include "charts.h" -#include <qchart.h> -#include <QGraphicsGridLayout> -#include <QGraphicsSceneMouseEvent> -#include <QDebug> - -Grid::Grid(int size, QGraphicsItem *parent) - : QGraphicsWidget(parent), - m_listCount(3), - m_valueMax(10), - m_valueCount(7), - m_size(size), - m_dataTable(Model::generateRandomData(m_listCount, m_valueMax, m_valueCount)), - m_state(NoState), - m_currentState(NoState), - m_rubberBand(new QGraphicsRectItem()), - m_gridLayout(new QGraphicsGridLayout()) -{ - setLayout(m_gridLayout); - m_rubberBand->setParentItem(this); - m_rubberBand->setVisible(false); - m_rubberBand->setZValue(2); -} - -Grid::~Grid() -{ - -} - -void Grid::createCharts(const QString &category) -{ - clear(); - - QChart *qchart(0); - Charts::ChartList list = Charts::chartList(); - - if (category.isEmpty()) { - for (int i = 0; i < m_size * m_size; ++i) { - QChart *chart = new QChart(); - chart->setTitle(QObject::tr("Empty")); - m_gridLayout->addItem(chart, i / m_size, i % m_size); - m_chartHash[chart] = i; - m_chartHashRev[i] = chart; - } - } else { - int j = 0; - for (int i = 0; i < list.size(); ++i) { - Chart *chart = list.at(i); - if (chart->category() == category && j < m_size * m_size) { - qchart = list.at(i)->createChart(m_dataTable); - m_gridLayout->addItem(qchart, j / m_size, j % m_size); - m_chartHash[qchart] = j; - m_chartHashRev[j] = qchart; - j++; - } - } - for (; j < m_size * m_size; ++j) { - qchart = new QChart(); - qchart->setTitle(QObject::tr("Empty")); - m_gridLayout->addItem(qchart, j / m_size, j % m_size); - m_chartHash[qchart] = j; - m_chartHashRev[j] = qchart; - } - } - m_gridLayout->activate(); -} - -void Grid::createCharts(const QString &category, const QString &subcategory, const QString &name) -{ - clear(); - - QChart *qchart(0); - Charts::ChartList list = Charts::chartList(); - Chart *chart; - - //find chart - for (int i = 0; i < list.size(); ++i) { - - chart = list.at(i); - if (chart->category() == category && - chart->subCategory() == subcategory && - chart->name() == name) { - break; - } - chart = 0; - } - - //create charts - for (int j = 0; j < m_size * m_size; ++j) { - - if(!chart){ - qchart = new QChart(); - }else{ - qchart = chart->createChart(m_dataTable); - } - qchart->setTitle(QObject::tr("Empty")); - m_gridLayout->addItem(qchart, j / m_size, j % m_size); - m_chartHash[qchart] = j; - m_chartHashRev[j] = qchart; - } - - m_gridLayout->activate(); -} - -void Grid::clear() -{ - int count = m_gridLayout->count(); - for (int i = 0; i < count; ++i) - m_gridLayout->removeAt(0); - - qDeleteAll(m_chartHash.keys()); - m_chartHash.clear(); - m_chartHashRev.clear(); -} - -QList<QChart *> Grid::charts() -{ - return m_chartHash.keys(); -} - -void Grid::setState(State state) -{ - m_state = state; -} - -void Grid::setSize(int size) -{ - if (m_size != size) { - - //remove old; - int count = m_gridLayout->count(); - for (int i = 0; i < count; ++i) { - m_gridLayout->removeAt(0); - } - - - QChart* qchart = 0; - int j = 0; - - for (; j < size * size; ++j) { - - qchart = m_chartHashRev[j]; - - if (!qchart){ - qchart = new QChart(); - qchart->setTitle(QObject::tr("Empty")); - } - - m_chartHash[qchart] = j; - m_chartHashRev[j] = qchart; - m_gridLayout->addItem(qchart, j / size, j % size); - } - - //delete rest - while (j < m_size * m_size) { - QChart* qchart = m_chartHashRev.take(j); - delete(qchart); - m_chartHash.remove(qchart); - j++; - } - - m_size = size; - } -} - -void Grid::setRubberPen(const QPen &pen) -{ - m_rubberBand->setPen(pen); -} - -void Grid::replaceChart(QChart *oldChart, Chart *newChart) -{ - int index = m_chartHash[oldChart]; - //not in 4.7.2 m_baseLayout->removeItem(qchart); - for (int i = 0; i < m_gridLayout->count(); ++i) { - if (m_gridLayout->itemAt(i) == oldChart) { - m_gridLayout->removeAt(i); - break; - } - } - m_chartHash.remove(oldChart); - m_chartHashRev.remove(index); - QChart *chart = newChart->createChart(m_dataTable); - m_gridLayout->addItem(chart, index / m_size, index % m_size); - m_chartHash[chart] = index; - m_chartHashRev[index] = chart; - delete oldChart; -} - -void Grid::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) { - - m_origin = event->pos(); - m_currentState = NoState; - - foreach (QChart *chart, charts()) { - QRectF geometryRect = chart->geometry(); - QRectF plotArea = chart->plotArea(); - plotArea.translate(geometryRect.topLeft()); - if (plotArea.contains(m_origin)) { - m_currentState = m_state; - if (m_currentState == NoState) emit chartSelected(chart); - break; - } - } - if (m_currentState == ZoomState) { - m_rubberBand->setRect(QRectF(m_origin, QSize())); - m_rubberBand->setVisible(true); - } - - event->accept(); - } - - if (event->button() == Qt::RightButton) { - m_origin = event->pos(); - m_currentState = m_state; - } -} - -void Grid::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - if (m_currentState != NoState) { - - foreach (QChart *chart, charts()) { - QRectF geometryRect = chart->geometry(); - QRectF plotArea = chart->plotArea(); - plotArea.translate(geometryRect.topLeft()); - if (plotArea.contains(m_origin)) { - if (m_currentState == ScrollState) { - QPointF delta = m_origin - event->pos(); - chart->scroll(delta.x(), -delta.y()); - } - if (m_currentState == ZoomState && plotArea.contains(event->pos())) - m_rubberBand->setRect(QRectF(m_origin, event->pos()).normalized()); - break; - } - } - if (m_currentState == ScrollState) - m_origin = event->pos(); - event->accept(); - } -} - -void Grid::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) { - if (m_currentState == ZoomState) { - m_rubberBand->setVisible(false); - - foreach (QChart *chart, charts()) { - QRectF geometryRect = chart->geometry(); - QRectF plotArea = chart->plotArea(); - plotArea.translate(geometryRect.topLeft()); - if (plotArea.contains(m_origin)) { - QRectF rect = m_rubberBand->rect(); - rect.translate(-geometryRect.topLeft()); - chart->zoomIn(rect); - break; - } - } - } - m_currentState = NoState; - event->accept(); - } - - if (event->button() == Qt::RightButton) { - if (m_currentState == ZoomState) { - foreach (QChart *chart, charts()) { - QRectF geometryRect = chart->geometry(); - QRectF plotArea = chart->plotArea(); - plotArea.translate(geometryRect.topLeft()); - if (plotArea.contains(m_origin)) { - chart->zoomOut(); - break; - } - } - } - } -} diff --git a/demos/chartviewer/grid.h b/demos/chartviewer/grid.h deleted file mode 100644 index 1682d30e..00000000 --- a/demos/chartviewer/grid.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRID_H_ -#define GRID_H_ - -#include "model.h" -#include <QGraphicsWidget> -#include <QChartGlobal> - -class QGraphicsGridLayout; -class Chart; - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - -class Grid : public QGraphicsWidget -{ - Q_OBJECT -public: - enum State { NoState = 0, ZoomState, ScrollState}; - - Grid(int size, QGraphicsItem *parent = 0); - ~Grid(); - - QList<QChart *> charts(); - void createCharts(const QString &category = QString()); - void createCharts(const QString &category, const QString &subcategory, const QString &name); - void replaceChart(QChart *oldChart, Chart *newChart); - void setState(State state); - State state() const { return m_state; }; - void setRubberPen(const QPen &pen); - void setSize(int size); - int size() const {return m_size;} - -Q_SIGNALS: - void chartSelected(QChart *chart); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - -private: - void clear(); - -private: - int m_listCount; - int m_valueMax; - int m_valueCount; - int m_size; - DataTable m_dataTable; - QHash<QChart *, int> m_chartHash; - QHash<int, QChart *> m_chartHashRev; - State m_state; - State m_currentState; - QPointF m_origin; - QGraphicsRectItem *m_rubberBand; - QGraphicsGridLayout *m_gridLayout; -}; - -#endif /* GRID_H_ */ diff --git a/demos/chartviewer/main.cpp b/demos/chartviewer/main.cpp deleted file mode 100644 index a68c2d8b..00000000 --- a/demos/chartviewer/main.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "window.h" -#include <QApplication> -#include <QMainWindow> -#include <iostream> - -QVariantHash parseArgs(QStringList args) -{ - QVariantHash parameters; - - while (!args.isEmpty()) { - - QString param = args.takeFirst(); - if (param.startsWith("--")) { - param.remove(0, 2); - - if (args.isEmpty() || args.first().startsWith("--")) { - parameters[param] = true; - } else { - QString value = args.takeFirst(); - if (value == "true" || value == "on" || value == "enabled") { - parameters[param] = true; - } else if (value == "false" || value == "off" || value == "disable") { - parameters[param] = false; - } else { - if (value.endsWith('"')) - value.chop(1); - if (value.startsWith('"')) - value.remove(0, 1); - parameters[param] = value; - } - } - } - } - - return parameters; -} - -void printHelp() -{ - std::cout << "chartviewer <options> "<< std::endl; - std::cout << " --view <1/2/3/4> - set size of charts' grid" << std::endl; - std::cout << " --chart <categoryName::subCategory::chartName> - set template to be show " << std::endl; - std::cout << " --opengl <enabled/disbaled> - set opengl mode" << std::endl; - std::cout << " --theme <name> - set theme" << std::endl; - std::cout << " --legend <alignment> - set legend alignment" << std::endl; - std::cout << " --help - prints this help" << std::endl; - std::cout << "Examples: " << std::endl; - std::cout << " chartviewer --view 4 --chart Axis" << std::endl; - std::cout << " chartviewer --view 1 --chart Axis::BarCategoryAxis::Axis " << std::endl; -} - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QVariantHash parameters = parseArgs(QApplication::arguments()); - if(parameters.contains("help")) - { - printHelp(); - return 0; - } - Window window(parameters); - window.show(); - return a.exec(); -} - diff --git a/demos/chartviewer/model.h b/demos/chartviewer/model.h deleted file mode 100644 index 2195b711..00000000 --- a/demos/chartviewer/model.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MODEL_H -#define MODEL_H - -#include <QList> -#include <QPair> -#include <QPointF> -#include <QTime> -#include <stdlib.h> - -typedef QPair<QPointF, QString> Data; -typedef QList<Data> DataList; -typedef QList<DataList> DataTable; - - -class Model -{ -private: - Model() {} - -public: - static DataTable generateRandomData(int listCount, int valueMax, int valueCount) - { - 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.1); - for (int j(0); j < valueCount; j++) { - yValue = yValue + (qreal)(qrand() % valueMax) / (qreal) valueCount; - QPointF value( - (j + (qreal) qrand() / (qreal) RAND_MAX) - * ((qreal) valueMax / (qreal) valueCount), yValue); - QString label = "Slice " + QString::number(i) + ":" + QString::number(j); - dataList << Data(value, label); - } - dataTable << dataList; - } - return dataTable; - } -}; - -#endif diff --git a/demos/chartviewer/view.cpp b/demos/chartviewer/view.cpp deleted file mode 100644 index e8b6aa9c..00000000 --- a/demos/chartviewer/view.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2012 Digia Plc - ** All rights reserved. - ** For any questions to Digia, please use contact form at http://qt.digia.com - ** - ** This file is part of the Qt Commercial Charts Add-on. - ** - ** $QT_BEGIN_LICENSE$ - ** Licensees holding valid Qt Commercial licenses may use this file in - ** accordance with the Qt Commercial License Agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and Digia. - ** - ** If you have questions regarding the use of this file, please use - ** contact form at http://qt.digia.com - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "view.h" -#include <QGraphicsWidget> -#include <QResizeEvent> -#include <QDebug> - -View::View(QGraphicsScene *scene, QGraphicsWidget *form , QWidget *parent) - : QGraphicsView(scene, parent), - m_form(form) -{ - setDragMode(QGraphicsView::NoDrag); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -} - -void View::resizeEvent(QResizeEvent *event) -{ - if (scene()) - scene()->setSceneRect(QRect(QPoint(0, 0), event->size())); - if (m_form) - m_form->resize(QSizeF(event->size())); - QGraphicsView::resizeEvent(event); -} - -void View::mouseMoveEvent(QMouseEvent *event) -{ - //BugFix somehow view always eats the mouse move event; - QGraphicsView::mouseMoveEvent(event); - event->setAccepted(false); -} - -void View::mouseReleaseEvent(QMouseEvent *event) -{ - QGraphicsView::mouseReleaseEvent(event); - //BugFix somehow view always eats the mouse release event; - event->setAccepted(false); -} diff --git a/demos/chartviewer/view.h b/demos/chartviewer/view.h deleted file mode 100644 index 7bc11eaa..00000000 --- a/demos/chartviewer/view.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIEW_H -#define VIEW_H -#include <QGraphicsView> - -class QGraphicsScene; -class QResizeEvent; - -class View: public QGraphicsView -{ -public: - View(QGraphicsScene *scene, QGraphicsWidget *form , QWidget *parent = 0); - -protected: - void resizeEvent(QResizeEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - -private: - QGraphicsWidget *m_form; -}; - -#endif diff --git a/demos/chartviewer/window.cpp b/demos/chartviewer/window.cpp deleted file mode 100644 index 9e50538d..00000000 --- a/demos/chartviewer/window.cpp +++ /dev/null @@ -1,502 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2012 Digia Plc - ** All rights reserved. - ** For any questions to Digia, please use contact form at http://qt.digia.com - ** - ** This file is part of the Qt Commercial Charts Add-on. - ** - ** $QT_BEGIN_LICENSE$ - ** Licensees holding valid Qt Commercial licenses may use this file in - ** accordance with the Qt Commercial License Agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and Digia. - ** - ** If you have questions regarding the use of this file, please use - ** contact form at http://qt.digia.com - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "window.h" -#include "view.h" -#include "grid.h" -#include "charts.h" -#include <QChartView> -#include <QAreaSeries> -#include <QLegend> -#include <QGridLayout> -#include <QFormLayout> -#include <QComboBox> -#include <QSpinBox> -#include <QCheckBox> -#include <QGroupBox> -#include <QLabel> -#include <QGraphicsScene> -#include <QGraphicsLinearLayout> -#include <QGraphicsProxyWidget> -#include <QGLWidget> -#include <QApplication> -#include <QDebug> -#include <QMenu> -#include <QPushButton> - -Window::Window(const QVariantHash ¶meters, QWidget *parent) - : QMainWindow(parent), - m_scene(new QGraphicsScene(this)), - m_view(0), - m_form(0), - m_themeComboBox(0), - m_antialiasCheckBox(0), - m_animatedComboBox(0), - m_legendComboBox(0), - m_templateComboBox(0), - m_viewComboBox(0), - m_openGLCheckBox(0), - m_zoomCheckBox(0), - m_scrollCheckBox(0), - m_baseLayout(new QGraphicsLinearLayout()), - m_menu(createMenu()), - m_template(0), - m_grid(new Grid(-1)) -{ - createProxyWidgets(); - // create layout - QGraphicsLinearLayout *settingsLayout = new QGraphicsLinearLayout(); - - settingsLayout->setOrientation(Qt::Vertical); - settingsLayout->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - settingsLayout->addItem(m_widgetHash["openGLCheckBox"]); - settingsLayout->addItem(m_widgetHash["antialiasCheckBox"]); - settingsLayout->addItem(m_widgetHash["viewLabel"]); - settingsLayout->addItem(m_widgetHash["viewComboBox"]); - settingsLayout->addItem(m_widgetHash["themeLabel"]); - settingsLayout->addItem(m_widgetHash["themeComboBox"]); - settingsLayout->addItem(m_widgetHash["animationsLabel"]); - settingsLayout->addItem(m_widgetHash["animatedComboBox"]); - settingsLayout->addItem(m_widgetHash["legendLabel"]); - settingsLayout->addItem(m_widgetHash["legendComboBox"]); - settingsLayout->addItem(m_widgetHash["templateLabel"]); - settingsLayout->addItem(m_widgetHash["templateComboBox"]); - settingsLayout->addItem(m_widgetHash["scrollCheckBox"]); - settingsLayout->addItem(m_widgetHash["zoomCheckBox"]); - settingsLayout->addStretch(); - - m_baseLayout->setOrientation(Qt::Horizontal); - m_baseLayout->addItem(m_grid); - m_baseLayout->addItem(settingsLayout); - - m_form = new QGraphicsWidget(); - m_form->setLayout(m_baseLayout); - m_scene->addItem(m_form); - - m_view = new View(m_scene, m_form); - m_view->setMinimumSize(m_form->minimumSize().toSize()); - - // Set defaults - m_antialiasCheckBox->setChecked(true); - initializeFromParamaters(parameters); - updateUI(); - if(!m_category.isEmpty() && !m_subcategory.isEmpty() && !m_name.isEmpty()) - m_grid->createCharts(m_category,m_subcategory,m_name); - - - handleGeometryChanged(); - setCentralWidget(m_view); - - connectSignals(); -} - -Window::~Window() -{ -} - -void Window::connectSignals() -{ - QObject::connect(m_form, SIGNAL(geometryChanged()), this , SLOT(handleGeometryChanged())); - QObject::connect(m_viewComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - QObject::connect(m_themeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - QObject::connect(m_antialiasCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateUI())); - QObject::connect(m_openGLCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateUI())); - QObject::connect(m_zoomCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateUI())); - QObject::connect(m_scrollCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateUI())); - QObject::connect(m_animatedComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - QObject::connect(m_legendComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - QObject::connect(m_templateComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateUI())); - QObject::connect(m_grid, SIGNAL(chartSelected(QChart*)), this, SLOT(handleChartSelected(QChart*))); -} - -void Window::createProxyWidgets() -{ - m_themeComboBox = createThemeBox(); - m_viewComboBox = createViewBox(); - m_antialiasCheckBox = new QCheckBox(tr("Anti-aliasing")); - m_animatedComboBox = createAnimationBox(); - m_legendComboBox = createLegendBox(); - m_openGLCheckBox = new QCheckBox(tr("OpenGL")); - m_zoomCheckBox = new QCheckBox(tr("Zoom")); - m_scrollCheckBox = new QCheckBox(tr("Scroll")); - m_templateComboBox = createTempleteBox(); - m_widgetHash["viewLabel"] = m_scene->addWidget(new QLabel("View")); - m_widgetHash["viewComboBox"] = m_scene->addWidget(m_viewComboBox); - m_widgetHash["themeComboBox"] = m_scene->addWidget(m_themeComboBox); - m_widgetHash["antialiasCheckBox"] = m_scene->addWidget(m_antialiasCheckBox); - m_widgetHash["animatedComboBox"] = m_scene->addWidget(m_animatedComboBox); - m_widgetHash["legendComboBox"] = m_scene->addWidget(m_legendComboBox); - m_widgetHash["openGLCheckBox"] = m_scene->addWidget(m_openGLCheckBox); - m_widgetHash["themeLabel"] = m_scene->addWidget(new QLabel("Theme")); - m_widgetHash["animationsLabel"] = m_scene->addWidget(new QLabel("Animations")); - m_widgetHash["legendLabel"] = m_scene->addWidget(new QLabel("Legend")); - m_widgetHash["templateLabel"] = m_scene->addWidget(new QLabel("Chart template")); - m_widgetHash["templateComboBox"] = m_scene->addWidget(m_templateComboBox); - m_widgetHash["zoomCheckBox"] = m_scene->addWidget(m_zoomCheckBox); - m_widgetHash["scrollCheckBox"] = m_scene->addWidget(m_scrollCheckBox); -} - -QComboBox *Window::createThemeBox() -{ - QComboBox *themeComboBox = new ComboBox(this); - 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); - return themeComboBox; -} - -QComboBox *Window::createViewBox() -{ - QComboBox *viewComboBox = new ComboBox(this); - viewComboBox->addItem("1 chart", 1); - viewComboBox->addItem("4 charts", 2); - viewComboBox->addItem("9 charts", 3); - viewComboBox->addItem("16 charts", 4); - return viewComboBox; -} - -QComboBox *Window::createAnimationBox() -{ - QComboBox *animationComboBox = new ComboBox(this); - 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 *Window::createLegendBox() -{ - QComboBox *legendComboBox = new ComboBox(this); - 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; -} - -QComboBox *Window::createTempleteBox() -{ - QComboBox *templateComboBox = new ComboBox(this); - templateComboBox->addItem("No Template", 0); - - Charts::ChartList list = Charts::chartList(); - QMultiMap<QString, Chart *> categoryMap; - - foreach (Chart *chart, list) - categoryMap.insertMulti(chart->category(), chart); - - foreach (const QString &category, categoryMap.uniqueKeys()) - templateComboBox->addItem(category, category); - - return templateComboBox; -} - -void Window::initializeFromParamaters(const QVariantHash ¶meters) -{ - if (parameters.contains("view")) { - int t = parameters["view"].toInt(); - for (int i = 0; i < m_viewComboBox->count(); ++i) { - if (m_viewComboBox->itemData(i).toInt() == t) { - m_viewComboBox->setCurrentIndex(i); - break; - } - } - } - - if (parameters.contains("chart")) { - QString t = parameters["chart"].toString(); - - QRegExp rx("([a-zA-Z0-9_]*)::([a-zA-Z0-9_]*)::([a-zA-Z0-9_]*)"); - int pos = rx.indexIn(t); - - if (pos > -1) { - m_category = rx.cap(1); - m_subcategory = rx.cap(2); - m_name = rx.cap(3); - m_templateComboBox->setCurrentIndex(0); - } - else { - for (int i = 0; i < m_templateComboBox->count(); ++i) { - if (m_templateComboBox->itemText(i) == t) { - m_templateComboBox->setCurrentIndex(i); - break; - } - } - } - } - if (parameters.contains("opengl")) { - bool checked = parameters["opengl"].toBool(); - m_openGLCheckBox->setChecked(checked); - } - if (parameters.contains("theme")) { - QString t = parameters["theme"].toString(); - for (int i = 0; i < m_themeComboBox->count(); ++i) { - if (m_themeComboBox->itemText(i) == t) { - m_themeComboBox->setCurrentIndex(i); - break; - } - } - } - if (parameters.contains("animation")) { - QString t = parameters["animation"].toString(); - for (int i = 0; i < m_animatedComboBox->count(); ++i) { - if (m_animatedComboBox->itemText(i) == t) { - m_animatedComboBox->setCurrentIndex(i); - break; - } - } - } - if (parameters.contains("legend")) { - QString t = parameters["legend"].toString(); - for (int i = 0; i < m_legendComboBox->count(); ++i) { - if (m_legendComboBox->itemText(i) == t) { - m_legendComboBox->setCurrentIndex(i); - break; - } - } - } -} - -void Window::updateUI() -{ - checkView(); - checkTemplate(); - checkOpenGL(); - checkTheme(); - checkAnimationOptions(); - checkLegend(); - checkState(); -} - -void Window::checkView() -{ - int count(m_viewComboBox->itemData(m_viewComboBox->currentIndex()).toInt()); - if(m_grid->size()!=count){ - m_grid->setSize(count); - m_template = 0; - } -} - -void Window::checkLegend() -{ - Qt::Alignment alignment(m_legendComboBox->itemData(m_legendComboBox->currentIndex()).toInt()); - - if (!alignment) { - foreach (QChart *chart, m_grid->charts()) - chart->legend()->hide(); - } else { - foreach (QChart *chart, m_grid->charts()) { - chart->legend()->setAlignment(alignment); - chart->legend()->show(); - } - } -} - -void Window::checkOpenGL() -{ - bool opengl = m_openGLCheckBox->isChecked(); - bool isOpengl = qobject_cast<QGLWidget *>(m_view->viewport()); - if ((isOpengl && !opengl) || (!isOpengl && opengl)) { - m_view->deleteLater(); - m_view = new View(m_scene, m_form); - m_view->setViewport(!opengl ? new QWidget() : new QGLWidget()); - setCentralWidget(m_view); - } - - bool antialias = m_antialiasCheckBox->isChecked(); - - if (opengl) - m_view->setRenderHint(QPainter::HighQualityAntialiasing, antialias); - else - m_view->setRenderHint(QPainter::Antialiasing, antialias); -} - -void Window::checkAnimationOptions() -{ - QChart::AnimationOptions options( - m_animatedComboBox->itemData(m_animatedComboBox->currentIndex()).toInt()); - - QList<QChart *> charts = m_grid->charts(); - - if (!charts.isEmpty() && charts.at(0)->animationOptions() != options) { - foreach (QChart *chart, charts) - chart->setAnimationOptions(options); - } -} - -void Window::checkState() -{ - bool scroll = m_scrollCheckBox->isChecked(); - - - if (m_grid->state() != Grid::ScrollState && scroll) { - m_grid->setState(Grid::ScrollState); - m_zoomCheckBox->setChecked(false); - } else if (!scroll && m_grid->state() == Grid::ScrollState) { - m_grid->setState(Grid::NoState); - } - - bool zoom = m_zoomCheckBox->isChecked(); - - if (m_grid->state() != Grid::ZoomState && zoom) { - m_grid->setState(Grid::ZoomState); - m_scrollCheckBox->setChecked(false); - } else if (!zoom && m_grid->state() == Grid::ZoomState) { - m_grid->setState(Grid::NoState); - } -} - -void Window::checkTemplate() -{ - int index = m_templateComboBox->currentIndex(); - if (m_template == index || index == 0) - return; - - m_template = index; - QString category = m_templateComboBox->itemData(index).toString(); - m_grid->createCharts(category); -} - -void Window::checkTheme() -{ - QChart::ChartTheme theme = (QChart::ChartTheme) m_themeComboBox->itemData( - m_themeComboBox->currentIndex()).toInt(); - - foreach (QChart *chart, m_grid->charts()) - 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)); - } - foreach (QGraphicsProxyWidget *widget, m_widgetHash) - widget->setPalette(pal); - m_view->setBackgroundBrush(pal.color((QPalette::Window))); - m_grid->setRubberPen(pal.color((QPalette::WindowText))); -} - -void Window::comboBoxFocused(QComboBox *combobox) -{ - foreach (QGraphicsProxyWidget *widget , m_widgetHash) { - if (widget->widget() == combobox) - widget->setZValue(2.0); - else - widget->setZValue(0.0); - } -} - -void Window::handleChartSelected(QChart *qchart) -{ - if (m_templateComboBox->currentIndex() != 0) - return; - - QAction *chosen = m_menu->exec(QCursor::pos()); - - if (chosen) { - Chart *chart = (Chart *) chosen->data().value<void *>(); - m_grid->replaceChart(qchart, chart); - updateUI(); - } -} - -QMenu *Window::createMenu() -{ - Charts::ChartList list = Charts::chartList(); - QMultiMap<QString, Chart *> categoryMap; - - QMenu *result = new QMenu(this); - - foreach (Chart *chart, list) - categoryMap.insertMulti(chart->category(), chart); - - foreach (const QString &category, categoryMap.uniqueKeys()) { - QMenu *menu(0); - QMultiMap<QString, Chart *> subCategoryMap; - if (category.isEmpty()) { - menu = result; - } else { - menu = new QMenu(category, this); - result->addMenu(menu); - } - - foreach (Chart *chart, categoryMap.values(category)) - subCategoryMap.insert(chart->subCategory(), chart); - - foreach (const QString &subCategory, subCategoryMap.uniqueKeys()) { - QMenu *subMenu(0); - if (subCategory.isEmpty()) { - subMenu = menu; - } else { - subMenu = new QMenu(subCategory, this); - menu->addMenu(subMenu); - } - - foreach (Chart *chart, subCategoryMap.values(subCategory)) { - createMenuAction(subMenu, QIcon(), chart->name(), - qVariantFromValue((void *) chart)); - } - } - } - return result; -} - -QAction *Window::createMenuAction(QMenu *menu, const QIcon &icon, const QString &text, - const QVariant &data) -{ - QAction *action = menu->addAction(icon, text); - action->setCheckable(false); - action->setData(data); - return action; -} - -void Window::handleGeometryChanged() -{ - QSizeF size = m_baseLayout->sizeHint(Qt::MinimumSize); - m_view->scene()->setSceneRect(0, 0, this->width(), this->height()); - m_view->setMinimumSize(size.toSize()); -} diff --git a/demos/chartviewer/window.h b/demos/chartviewer/window.h deleted file mode 100644 index bfc914d7..00000000 --- a/demos/chartviewer/window.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WINDOW_H -#define WINDOW_H -#include <QMainWindow> -#include <QChartGlobal> -#include <QHash> -#include <QComboBox> - -class QCheckBox; -class QGraphicsRectItem; -class QGraphicsScene; -class QGraphicsWidget; -class View; -class QGraphicsLinearLayout; -class Chart; -class Grid; -class QPushButton; - -QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChart; -QTCOMMERCIALCHART_END_NAMESPACE - -QTCOMMERCIALCHART_USE_NAMESPACE - - -class Window: public QMainWindow -{ - Q_OBJECT -public: - explicit Window(const QVariantHash ¶meters, QWidget *parent = 0); - ~Window(); - -private Q_SLOTS: - void updateUI(); - void handleGeometryChanged(); - void handleChartSelected(QChart *chart); -private: - QComboBox *createViewBox(); - QComboBox *createThemeBox(); - QComboBox *createAnimationBox(); - QComboBox *createLegendBox(); - QComboBox *createTempleteBox(); - void connectSignals(); - void createProxyWidgets(); - void comboBoxFocused(QComboBox *combox); - inline void checkAnimationOptions(); - inline void checkView(); - inline void checkLegend(); - inline void checkOpenGL(); - inline void checkTheme(); - inline void checkState(); - inline void checkTemplate(); - QMenu *createMenu(); - QAction *createMenuAction(QMenu *menu, const QIcon &icon, const QString &text, const QVariant &data); - void initializeFromParamaters(const QVariantHash ¶meters); - -private: - QGraphicsScene *m_scene; - View *m_view; - QHash<QString, QGraphicsProxyWidget *> m_widgetHash; - - QGraphicsWidget *m_form; - QComboBox *m_themeComboBox; - QCheckBox *m_antialiasCheckBox; - QComboBox *m_animatedComboBox; - QComboBox *m_legendComboBox; - QComboBox *m_templateComboBox; - QComboBox *m_viewComboBox; - QCheckBox *m_openGLCheckBox; - QCheckBox *m_zoomCheckBox; - QCheckBox *m_scrollCheckBox; - QGraphicsLinearLayout *m_baseLayout; - QMenu *m_menu; - int m_template; - Grid *m_grid; - QString m_category; - QString m_subcategory; - QString m_name; - - friend class ComboBox; -}; - -class ComboBox: public QComboBox -{ -public: - ComboBox(Window *window, QWidget *parent = 0): QComboBox(parent), m_window(window) - {} - -protected: - void focusInEvent(QFocusEvent *e) { - QComboBox::focusInEvent(e); - m_window->comboBoxFocused(this); - } -private: - Window *m_window; -}; - -#endif diff --git a/demos/demos.pro b/demos/demos.pro index eb09747f..43f6c933 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -19,8 +19,7 @@ SUBDIRS += piechartcustomization \ contains(QT_CONFIG, opengl) { SUBDIRS += chartthemes \ - qmloscilloscope \ - chartviewer + qmloscilloscope } else { message("OpenGL not available. Some demos are disabled") } |