diff --git a/.gitattributes b/.gitattributes index 26f7dd2..e4b9352 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,5 +2,4 @@ .gitignore export-ignore .gitattributes export-ignore .commit-template export-ignore -tests export-ignore tools export-ignore diff --git a/tests/.gitattributes b/tests/.gitattributes new file mode 100644 index 0000000..fbbe17a --- /dev/null +++ b/tests/.gitattributes @@ -0,0 +1,2 @@ +.gitattributes export-ignore +manual export-ignore diff --git a/tests/boxplottester/boxplottester.pro b/tests/manual/boxplottester/boxplottester.pro similarity index 92% rename from tests/boxplottester/boxplottester.pro rename to tests/manual/boxplottester/boxplottester.pro index 2568adc..1a8681f 100644 --- a/tests/boxplottester/boxplottester.pro +++ b/tests/manual/boxplottester/boxplottester.pro @@ -1,4 +1,4 @@ -!include( ../tests.pri ) { +!include( ../../tests.pri ) { error( "Couldn't find the test.pri file!" ) } diff --git a/tests/boxplottester/customtablemodel.cpp b/tests/manual/boxplottester/customtablemodel.cpp similarity index 100% rename from tests/boxplottester/customtablemodel.cpp rename to tests/manual/boxplottester/customtablemodel.cpp diff --git a/tests/boxplottester/customtablemodel.h b/tests/manual/boxplottester/customtablemodel.h similarity index 100% rename from tests/boxplottester/customtablemodel.h rename to tests/manual/boxplottester/customtablemodel.h diff --git a/tests/boxplottester/main.cpp b/tests/manual/boxplottester/main.cpp similarity index 100% rename from tests/boxplottester/main.cpp rename to tests/manual/boxplottester/main.cpp diff --git a/tests/boxplottester/mainwidget.cpp b/tests/manual/boxplottester/mainwidget.cpp similarity index 100% rename from tests/boxplottester/mainwidget.cpp rename to tests/manual/boxplottester/mainwidget.cpp diff --git a/tests/boxplottester/mainwidget.h b/tests/manual/boxplottester/mainwidget.h similarity index 100% rename from tests/boxplottester/mainwidget.h rename to tests/manual/boxplottester/mainwidget.h diff --git a/tests/boxplottester/pentool.cpp b/tests/manual/boxplottester/pentool.cpp similarity index 100% rename from tests/boxplottester/pentool.cpp rename to tests/manual/boxplottester/pentool.cpp diff --git a/tests/boxplottester/pentool.h b/tests/manual/boxplottester/pentool.h similarity index 100% rename from tests/boxplottester/pentool.h rename to tests/manual/boxplottester/pentool.h diff --git a/tests/chartdesigner/brushwidget.cpp b/tests/manual/chartdesigner/brushwidget.cpp similarity index 100% rename from tests/chartdesigner/brushwidget.cpp rename to tests/manual/chartdesigner/brushwidget.cpp diff --git a/tests/chartdesigner/brushwidget.h b/tests/manual/chartdesigner/brushwidget.h similarity index 100% rename from tests/chartdesigner/brushwidget.h rename to tests/manual/chartdesigner/brushwidget.h diff --git a/tests/chartdesigner/chartdesigner.pro b/tests/manual/chartdesigner/chartdesigner.pro similarity index 100% rename from tests/chartdesigner/chartdesigner.pro rename to tests/manual/chartdesigner/chartdesigner.pro diff --git a/tests/chartdesigner/engine.cpp b/tests/manual/chartdesigner/engine.cpp similarity index 100% rename from tests/chartdesigner/engine.cpp rename to tests/manual/chartdesigner/engine.cpp diff --git a/tests/chartdesigner/engine.h b/tests/manual/chartdesigner/engine.h similarity index 100% rename from tests/chartdesigner/engine.h rename to tests/manual/chartdesigner/engine.h diff --git a/tests/chartdesigner/main.cpp b/tests/manual/chartdesigner/main.cpp similarity index 100% rename from tests/chartdesigner/main.cpp rename to tests/manual/chartdesigner/main.cpp diff --git a/tests/chartdesigner/mainwindow.cpp b/tests/manual/chartdesigner/mainwindow.cpp similarity index 100% rename from tests/chartdesigner/mainwindow.cpp rename to tests/manual/chartdesigner/mainwindow.cpp diff --git a/tests/chartdesigner/mainwindow.h b/tests/manual/chartdesigner/mainwindow.h similarity index 100% rename from tests/chartdesigner/mainwindow.h rename to tests/manual/chartdesigner/mainwindow.h diff --git a/tests/chartdesigner/objectinspectorwidget.cpp b/tests/manual/chartdesigner/objectinspectorwidget.cpp similarity index 100% rename from tests/chartdesigner/objectinspectorwidget.cpp rename to tests/manual/chartdesigner/objectinspectorwidget.cpp diff --git a/tests/chartdesigner/objectinspectorwidget.h b/tests/manual/chartdesigner/objectinspectorwidget.h similarity index 100% rename from tests/chartdesigner/objectinspectorwidget.h rename to tests/manual/chartdesigner/objectinspectorwidget.h diff --git a/tests/chartdesigner/penwidget.cpp b/tests/manual/chartdesigner/penwidget.cpp similarity index 100% rename from tests/chartdesigner/penwidget.cpp rename to tests/manual/chartdesigner/penwidget.cpp diff --git a/tests/chartdesigner/penwidget.h b/tests/manual/chartdesigner/penwidget.h similarity index 100% rename from tests/chartdesigner/penwidget.h rename to tests/manual/chartdesigner/penwidget.h diff --git a/tests/chartviewer/charts.h b/tests/manual/chartviewer/charts.h similarity index 100% rename from tests/chartviewer/charts.h rename to tests/manual/chartviewer/charts.h diff --git a/tests/chartviewer/charts/axis/barcategoryaxisx.cpp b/tests/manual/chartviewer/charts/axis/barcategoryaxisx.cpp similarity index 100% rename from tests/chartviewer/charts/axis/barcategoryaxisx.cpp rename to tests/manual/chartviewer/charts/axis/barcategoryaxisx.cpp diff --git a/tests/chartviewer/charts/axis/barcategoryaxisxlogy.cpp b/tests/manual/chartviewer/charts/axis/barcategoryaxisxlogy.cpp similarity index 100% rename from tests/chartviewer/charts/axis/barcategoryaxisxlogy.cpp rename to tests/manual/chartviewer/charts/axis/barcategoryaxisxlogy.cpp diff --git a/tests/chartviewer/charts/axis/barcategoryaxisy.cpp b/tests/manual/chartviewer/charts/axis/barcategoryaxisy.cpp similarity index 100% rename from tests/chartviewer/charts/axis/barcategoryaxisy.cpp rename to tests/manual/chartviewer/charts/axis/barcategoryaxisy.cpp diff --git a/tests/chartviewer/charts/axis/barcategoryaxisylogx.cpp b/tests/manual/chartviewer/charts/axis/barcategoryaxisylogx.cpp similarity index 100% rename from tests/chartviewer/charts/axis/barcategoryaxisylogx.cpp rename to tests/manual/chartviewer/charts/axis/barcategoryaxisylogx.cpp diff --git a/tests/chartviewer/charts/axis/categoryaxis.cpp b/tests/manual/chartviewer/charts/axis/categoryaxis.cpp similarity index 100% rename from tests/chartviewer/charts/axis/categoryaxis.cpp rename to tests/manual/chartviewer/charts/axis/categoryaxis.cpp diff --git a/tests/chartviewer/charts/axis/datetimeaxisx.cpp b/tests/manual/chartviewer/charts/axis/datetimeaxisx.cpp similarity index 100% rename from tests/chartviewer/charts/axis/datetimeaxisx.cpp rename to tests/manual/chartviewer/charts/axis/datetimeaxisx.cpp diff --git a/tests/chartviewer/charts/axis/datetimeaxisy.cpp b/tests/manual/chartviewer/charts/axis/datetimeaxisy.cpp similarity index 100% rename from tests/chartviewer/charts/axis/datetimeaxisy.cpp rename to tests/manual/chartviewer/charts/axis/datetimeaxisy.cpp diff --git a/tests/chartviewer/charts/axis/logvalueaxisx.cpp b/tests/manual/chartviewer/charts/axis/logvalueaxisx.cpp similarity index 100% rename from tests/chartviewer/charts/axis/logvalueaxisx.cpp rename to tests/manual/chartviewer/charts/axis/logvalueaxisx.cpp diff --git a/tests/chartviewer/charts/axis/logvalueaxisy.cpp b/tests/manual/chartviewer/charts/axis/logvalueaxisy.cpp similarity index 100% rename from tests/chartviewer/charts/axis/logvalueaxisy.cpp rename to tests/manual/chartviewer/charts/axis/logvalueaxisy.cpp diff --git a/tests/chartviewer/charts/axis/valueaxis.cpp b/tests/manual/chartviewer/charts/axis/valueaxis.cpp similarity index 100% rename from tests/chartviewer/charts/axis/valueaxis.cpp rename to tests/manual/chartviewer/charts/axis/valueaxis.cpp diff --git a/tests/chartviewer/charts/barseries/horizontalbarchart.cpp b/tests/manual/chartviewer/charts/barseries/horizontalbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/horizontalbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/horizontalbarchart.cpp diff --git a/tests/chartviewer/charts/barseries/horizontalpercentbarchart.cpp b/tests/manual/chartviewer/charts/barseries/horizontalpercentbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/horizontalpercentbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/horizontalpercentbarchart.cpp diff --git a/tests/chartviewer/charts/barseries/horizontalstackedbarchart.cpp b/tests/manual/chartviewer/charts/barseries/horizontalstackedbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/horizontalstackedbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/horizontalstackedbarchart.cpp diff --git a/tests/chartviewer/charts/barseries/verticalbarchart.cpp b/tests/manual/chartviewer/charts/barseries/verticalbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/verticalbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/verticalbarchart.cpp diff --git a/tests/chartviewer/charts/barseries/verticalpercentbarchart.cpp b/tests/manual/chartviewer/charts/barseries/verticalpercentbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/verticalpercentbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/verticalpercentbarchart.cpp diff --git a/tests/chartviewer/charts/barseries/verticalstackedbarchart.cpp b/tests/manual/chartviewer/charts/barseries/verticalstackedbarchart.cpp similarity index 100% rename from tests/chartviewer/charts/barseries/verticalstackedbarchart.cpp rename to tests/manual/chartviewer/charts/barseries/verticalstackedbarchart.cpp diff --git a/tests/chartviewer/charts/charts.pri b/tests/manual/chartviewer/charts/charts.pri similarity index 100% rename from tests/chartviewer/charts/charts.pri rename to tests/manual/chartviewer/charts/charts.pri diff --git a/tests/chartviewer/charts/domain/barlogx.cpp b/tests/manual/chartviewer/charts/domain/barlogx.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barlogx.cpp rename to tests/manual/chartviewer/charts/domain/barlogx.cpp diff --git a/tests/chartviewer/charts/domain/barlogy.cpp b/tests/manual/chartviewer/charts/domain/barlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barlogy.cpp rename to tests/manual/chartviewer/charts/domain/barlogy.cpp diff --git a/tests/chartviewer/charts/domain/barpercentlogx.cpp b/tests/manual/chartviewer/charts/domain/barpercentlogx.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barpercentlogx.cpp rename to tests/manual/chartviewer/charts/domain/barpercentlogx.cpp diff --git a/tests/chartviewer/charts/domain/barpercentlogy.cpp b/tests/manual/chartviewer/charts/domain/barpercentlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barpercentlogy.cpp rename to tests/manual/chartviewer/charts/domain/barpercentlogy.cpp diff --git a/tests/chartviewer/charts/domain/barstackedlogx.cpp b/tests/manual/chartviewer/charts/domain/barstackedlogx.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barstackedlogx.cpp rename to tests/manual/chartviewer/charts/domain/barstackedlogx.cpp diff --git a/tests/chartviewer/charts/domain/barstackedlogy.cpp b/tests/manual/chartviewer/charts/domain/barstackedlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/barstackedlogy.cpp rename to tests/manual/chartviewer/charts/domain/barstackedlogy.cpp diff --git a/tests/chartviewer/charts/domain/linelogxlogy.cpp b/tests/manual/chartviewer/charts/domain/linelogxlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/linelogxlogy.cpp rename to tests/manual/chartviewer/charts/domain/linelogxlogy.cpp diff --git a/tests/chartviewer/charts/domain/linelogxy.cpp b/tests/manual/chartviewer/charts/domain/linelogxy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/linelogxy.cpp rename to tests/manual/chartviewer/charts/domain/linelogxy.cpp diff --git a/tests/chartviewer/charts/domain/linexlogy.cpp b/tests/manual/chartviewer/charts/domain/linexlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/linexlogy.cpp rename to tests/manual/chartviewer/charts/domain/linexlogy.cpp diff --git a/tests/chartviewer/charts/domain/scatterlogxlogy.cpp b/tests/manual/chartviewer/charts/domain/scatterlogxlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/scatterlogxlogy.cpp rename to tests/manual/chartviewer/charts/domain/scatterlogxlogy.cpp diff --git a/tests/chartviewer/charts/domain/scatterlogxy.cpp b/tests/manual/chartviewer/charts/domain/scatterlogxy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/scatterlogxy.cpp rename to tests/manual/chartviewer/charts/domain/scatterlogxy.cpp diff --git a/tests/chartviewer/charts/domain/scatterxlogy.cpp b/tests/manual/chartviewer/charts/domain/scatterxlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/scatterxlogy.cpp rename to tests/manual/chartviewer/charts/domain/scatterxlogy.cpp diff --git a/tests/chartviewer/charts/domain/splinelogxlogy.cpp b/tests/manual/chartviewer/charts/domain/splinelogxlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/splinelogxlogy.cpp rename to tests/manual/chartviewer/charts/domain/splinelogxlogy.cpp diff --git a/tests/chartviewer/charts/domain/splinelogxy.cpp b/tests/manual/chartviewer/charts/domain/splinelogxy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/splinelogxy.cpp rename to tests/manual/chartviewer/charts/domain/splinelogxy.cpp diff --git a/tests/chartviewer/charts/domain/splinexlogy.cpp b/tests/manual/chartviewer/charts/domain/splinexlogy.cpp similarity index 100% rename from tests/chartviewer/charts/domain/splinexlogy.cpp rename to tests/manual/chartviewer/charts/domain/splinexlogy.cpp diff --git a/tests/chartviewer/charts/font/font.cpp b/tests/manual/chartviewer/charts/font/font.cpp similarity index 100% rename from tests/chartviewer/charts/font/font.cpp rename to tests/manual/chartviewer/charts/font/font.cpp diff --git a/tests/chartviewer/charts/multiaxis/multivalueaxis.cpp b/tests/manual/chartviewer/charts/multiaxis/multivalueaxis.cpp similarity index 100% rename from tests/chartviewer/charts/multiaxis/multivalueaxis.cpp rename to tests/manual/chartviewer/charts/multiaxis/multivalueaxis.cpp diff --git a/tests/chartviewer/charts/multiaxis/multivalueaxis2.cpp b/tests/manual/chartviewer/charts/multiaxis/multivalueaxis2.cpp similarity index 100% rename from tests/chartviewer/charts/multiaxis/multivalueaxis2.cpp rename to tests/manual/chartviewer/charts/multiaxis/multivalueaxis2.cpp diff --git a/tests/chartviewer/charts/multiaxis/multivalueaxis3.cpp b/tests/manual/chartviewer/charts/multiaxis/multivalueaxis3.cpp similarity index 100% rename from tests/chartviewer/charts/multiaxis/multivalueaxis3.cpp rename to tests/manual/chartviewer/charts/multiaxis/multivalueaxis3.cpp diff --git a/tests/chartviewer/charts/multiaxis/multivalueaxis4.cpp b/tests/manual/chartviewer/charts/multiaxis/multivalueaxis4.cpp similarity index 100% rename from tests/chartviewer/charts/multiaxis/multivalueaxis4.cpp rename to tests/manual/chartviewer/charts/multiaxis/multivalueaxis4.cpp diff --git a/tests/chartviewer/charts/multiaxis/multivaluebaraxis.cpp b/tests/manual/chartviewer/charts/multiaxis/multivaluebaraxis.cpp similarity index 100% rename from tests/chartviewer/charts/multiaxis/multivaluebaraxis.cpp rename to tests/manual/chartviewer/charts/multiaxis/multivaluebaraxis.cpp diff --git a/tests/chartviewer/charts/pieseries/donutchart.cpp b/tests/manual/chartviewer/charts/pieseries/donutchart.cpp similarity index 100% rename from tests/chartviewer/charts/pieseries/donutchart.cpp rename to tests/manual/chartviewer/charts/pieseries/donutchart.cpp diff --git a/tests/chartviewer/charts/pieseries/piechart.cpp b/tests/manual/chartviewer/charts/pieseries/piechart.cpp similarity index 100% rename from tests/chartviewer/charts/pieseries/piechart.cpp rename to tests/manual/chartviewer/charts/pieseries/piechart.cpp diff --git a/tests/chartviewer/charts/size/sizecharts.cpp b/tests/manual/chartviewer/charts/size/sizecharts.cpp similarity index 100% rename from tests/chartviewer/charts/size/sizecharts.cpp rename to tests/manual/chartviewer/charts/size/sizecharts.cpp diff --git a/tests/chartviewer/charts/xyseries/areachart.cpp b/tests/manual/chartviewer/charts/xyseries/areachart.cpp similarity index 100% rename from tests/chartviewer/charts/xyseries/areachart.cpp rename to tests/manual/chartviewer/charts/xyseries/areachart.cpp diff --git a/tests/chartviewer/charts/xyseries/linechart.cpp b/tests/manual/chartviewer/charts/xyseries/linechart.cpp similarity index 100% rename from tests/chartviewer/charts/xyseries/linechart.cpp rename to tests/manual/chartviewer/charts/xyseries/linechart.cpp diff --git a/tests/chartviewer/charts/xyseries/scatterchart.cpp b/tests/manual/chartviewer/charts/xyseries/scatterchart.cpp similarity index 100% rename from tests/chartviewer/charts/xyseries/scatterchart.cpp rename to tests/manual/chartviewer/charts/xyseries/scatterchart.cpp diff --git a/tests/chartviewer/charts/xyseries/splinechart.cpp b/tests/manual/chartviewer/charts/xyseries/splinechart.cpp similarity index 100% rename from tests/chartviewer/charts/xyseries/splinechart.cpp rename to tests/manual/chartviewer/charts/xyseries/splinechart.cpp diff --git a/tests/chartviewer/chartviewer.pro b/tests/manual/chartviewer/chartviewer.pro similarity index 75% rename from tests/chartviewer/chartviewer.pro rename to tests/manual/chartviewer/chartviewer.pro index c306252..693c1ea 100644 --- a/tests/chartviewer/chartviewer.pro +++ b/tests/manual/chartviewer/chartviewer.pro @@ -1,4 +1,6 @@ -!include( ../tests.pri ):error( "Couldn't find the tests.pri file!" ) +!include( ../../tests.pri ) { + error( "Couldn't find the test.pri file!" ) +} include(charts/charts.pri) TARGET = chartviewer QT += opengl diff --git a/tests/chartviewer/grid.cpp b/tests/manual/chartviewer/grid.cpp similarity index 100% rename from tests/chartviewer/grid.cpp rename to tests/manual/chartviewer/grid.cpp diff --git a/tests/chartviewer/grid.h b/tests/manual/chartviewer/grid.h similarity index 100% rename from tests/chartviewer/grid.h rename to tests/manual/chartviewer/grid.h diff --git a/tests/chartviewer/main.cpp b/tests/manual/chartviewer/main.cpp similarity index 100% rename from tests/chartviewer/main.cpp rename to tests/manual/chartviewer/main.cpp diff --git a/tests/chartviewer/model.h b/tests/manual/chartviewer/model.h similarity index 100% rename from tests/chartviewer/model.h rename to tests/manual/chartviewer/model.h diff --git a/tests/chartviewer/view.cpp b/tests/manual/chartviewer/view.cpp similarity index 100% rename from tests/chartviewer/view.cpp rename to tests/manual/chartviewer/view.cpp diff --git a/tests/chartviewer/view.h b/tests/manual/chartviewer/view.h similarity index 100% rename from tests/chartviewer/view.h rename to tests/manual/chartviewer/view.h diff --git a/tests/chartviewer/window.cpp b/tests/manual/chartviewer/window.cpp similarity index 100% rename from tests/chartviewer/window.cpp rename to tests/manual/chartviewer/window.cpp diff --git a/tests/chartviewer/window.h b/tests/manual/chartviewer/window.h similarity index 100% rename from tests/chartviewer/window.h rename to tests/manual/chartviewer/window.h diff --git a/tests/chartwidgettest/chartwidgettest.pro b/tests/manual/chartwidgettest/chartwidgettest.pro similarity index 90% rename from tests/chartwidgettest/chartwidgettest.pro rename to tests/manual/chartwidgettest/chartwidgettest.pro index db8416b..3f4cdbb 100644 --- a/tests/chartwidgettest/chartwidgettest.pro +++ b/tests/manual/chartwidgettest/chartwidgettest.pro @@ -1,4 +1,4 @@ -!include( ../tests.pri ) { +!include( ../../tests.pri ) { error( "Couldn't find the test.pri file!" ) } diff --git a/tests/chartwidgettest/dataseriedialog.cpp b/tests/manual/chartwidgettest/dataseriedialog.cpp similarity index 100% rename from tests/chartwidgettest/dataseriedialog.cpp rename to tests/manual/chartwidgettest/dataseriedialog.cpp index 622e975..41ca56d 100644 --- a/tests/chartwidgettest/dataseriedialog.cpp +++ b/tests/manual/chartwidgettest/dataseriedialog.cpp @@ -1,189 +1,189 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "dataseriedialog.h" -#include -#include -#include -#include -#include -#include -#include -#include - -DataSerieDialog::DataSerieDialog(QWidget *parent) : - QDialog(parent) -{ - QDialogButtonBox *addSeriesBox = new QDialogButtonBox(Qt::Horizontal); - QPushButton *b = addSeriesBox->addButton(QDialogButtonBox::Ok); - connect(b, SIGNAL(clicked()), this, SLOT(accept())); - b = addSeriesBox->addButton(QDialogButtonBox::Cancel); - connect(b, SIGNAL(clicked()), this, SLOT(reject())); - - QGridLayout *grid = new QGridLayout(); - - m_seriesTypeSelector = seriesTypeSelector(); - m_columnCountSelector = columnCountSelector(); - m_rowCountSelector = rowCountSelector(); - m_dataCharacteristicsSelector = dataCharacteristicsSelector(); - - grid->addWidget(m_seriesTypeSelector, 0, 0); - grid->addWidget(m_columnCountSelector, 0, 1); - grid->addWidget(m_rowCountSelector, 1, 1); - grid->addWidget(m_dataCharacteristicsSelector, 1, 0); - m_labelsSelector = new QCheckBox("Labels defined"); - m_labelsSelector->setChecked(true); - grid->addWidget(m_labelsSelector, 2, 0); - grid->addWidget(addSeriesBox, 3, 1); - - setLayout(grid); -} - -QGroupBox *DataSerieDialog::seriesTypeSelector() -{ - QVBoxLayout *layout = new QVBoxLayout(); - - QRadioButton *line = new QRadioButton("Line"); - line->setChecked(true); - layout->addWidget(line); - layout->addWidget(new QRadioButton("Area")); - layout->addWidget(new QRadioButton("Pie")); - layout->addWidget(new QRadioButton("Bar")); - layout->addWidget(new QRadioButton("Stacked bar")); - layout->addWidget(new QRadioButton("Percent bar")); - layout->addWidget(new QRadioButton("Scatter")); - layout->addWidget(new QRadioButton("Spline")); - - QGroupBox *groupBox = new QGroupBox("Series type"); - groupBox->setLayout(layout); - selectRadio(groupBox, 0); - - return groupBox; -} - -QGroupBox *DataSerieDialog::columnCountSelector() -{ - QVBoxLayout *layout = new QVBoxLayout(); - - QRadioButton *radio = new QRadioButton("1"); - radio->setChecked(true); - layout->addWidget(radio); - layout->addWidget(new QRadioButton("2")); - layout->addWidget(new QRadioButton("3")); - layout->addWidget(new QRadioButton("4")); - layout->addWidget(new QRadioButton("5")); - layout->addWidget(new QRadioButton("8")); - layout->addWidget(new QRadioButton("10")); - layout->addWidget(new QRadioButton("100")); - - QGroupBox *groupBox = new QGroupBox("Column count"); - groupBox->setLayout(layout); - selectRadio(groupBox, 0); - - return groupBox; -} - -QGroupBox *DataSerieDialog::rowCountSelector() -{ - QVBoxLayout *layout = new QVBoxLayout(); - - layout->addWidget(new QRadioButton("1")); - QRadioButton *radio = new QRadioButton("10"); - radio->setChecked(true); - layout->addWidget(radio); - layout->addWidget(new QRadioButton("50")); - layout->addWidget(new QRadioButton("100")); - layout->addWidget(new QRadioButton("1000")); - layout->addWidget(new QRadioButton("10000")); - layout->addWidget(new QRadioButton("100000")); - layout->addWidget(new QRadioButton("1000000")); - - QGroupBox *groupBox = new QGroupBox("Row count"); - groupBox->setLayout(layout); - selectRadio(groupBox, 0); - - return groupBox; -} - -QGroupBox *DataSerieDialog::dataCharacteristicsSelector() -{ - QVBoxLayout *layout = new QVBoxLayout(); - - layout->addWidget(new QRadioButton("Linear")); - layout->addWidget(new QRadioButton("Constant")); - layout->addWidget(new QRadioButton("Random")); - layout->addWidget(new QRadioButton("Sin")); - layout->addWidget(new QRadioButton("Sin + random")); - - QGroupBox *groupBox = new QGroupBox("Data Characteristics"); - groupBox->setLayout(layout); - selectRadio(groupBox, 0); - - return groupBox; -} - -void DataSerieDialog::accept() -{ - accepted(radioSelection(m_seriesTypeSelector), - radioSelection(m_columnCountSelector).toInt(), - radioSelection(m_rowCountSelector).toInt(), - radioSelection(m_dataCharacteristicsSelector), - m_labelsSelector->isChecked()); - QDialog::accept(); -} - -void DataSerieDialog::selectRadio(QGroupBox *groupBox, int defaultSelection) -{ - QVBoxLayout *layout = qobject_cast(groupBox->layout()); - Q_ASSERT(layout); - Q_ASSERT(layout->count()); - - QLayoutItem *item = 0; - if (defaultSelection == -1) { - item = layout->itemAt(0); - } else if (layout->count() > defaultSelection) { - item = layout->itemAt(defaultSelection); - } - Q_ASSERT(item); - QRadioButton *radio = qobject_cast(item->widget()); - Q_ASSERT(radio); - radio->setChecked(true); -} - -QString DataSerieDialog::radioSelection(QGroupBox *groupBox) -{ - QString selection; - QVBoxLayout *layout = qobject_cast(groupBox->layout()); - Q_ASSERT(layout); - - for (int i(0); i < layout->count(); i++) { - QLayoutItem *item = layout->itemAt(i); - Q_ASSERT(item); - QRadioButton *radio = qobject_cast(item->widget()); - Q_ASSERT(radio); - if (radio->isChecked()) { - selection = radio->text(); - break; - } - } - - qDebug() << "radioSelection: " << selection; - return selection; -} +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "dataseriedialog.h" +#include +#include +#include +#include +#include +#include +#include +#include + +DataSerieDialog::DataSerieDialog(QWidget *parent) : + QDialog(parent) +{ + QDialogButtonBox *addSeriesBox = new QDialogButtonBox(Qt::Horizontal); + QPushButton *b = addSeriesBox->addButton(QDialogButtonBox::Ok); + connect(b, SIGNAL(clicked()), this, SLOT(accept())); + b = addSeriesBox->addButton(QDialogButtonBox::Cancel); + connect(b, SIGNAL(clicked()), this, SLOT(reject())); + + QGridLayout *grid = new QGridLayout(); + + m_seriesTypeSelector = seriesTypeSelector(); + m_columnCountSelector = columnCountSelector(); + m_rowCountSelector = rowCountSelector(); + m_dataCharacteristicsSelector = dataCharacteristicsSelector(); + + grid->addWidget(m_seriesTypeSelector, 0, 0); + grid->addWidget(m_columnCountSelector, 0, 1); + grid->addWidget(m_rowCountSelector, 1, 1); + grid->addWidget(m_dataCharacteristicsSelector, 1, 0); + m_labelsSelector = new QCheckBox("Labels defined"); + m_labelsSelector->setChecked(true); + grid->addWidget(m_labelsSelector, 2, 0); + grid->addWidget(addSeriesBox, 3, 1); + + setLayout(grid); +} + +QGroupBox *DataSerieDialog::seriesTypeSelector() +{ + QVBoxLayout *layout = new QVBoxLayout(); + + QRadioButton *line = new QRadioButton("Line"); + line->setChecked(true); + layout->addWidget(line); + layout->addWidget(new QRadioButton("Area")); + layout->addWidget(new QRadioButton("Pie")); + layout->addWidget(new QRadioButton("Bar")); + layout->addWidget(new QRadioButton("Stacked bar")); + layout->addWidget(new QRadioButton("Percent bar")); + layout->addWidget(new QRadioButton("Scatter")); + layout->addWidget(new QRadioButton("Spline")); + + QGroupBox *groupBox = new QGroupBox("Series type"); + groupBox->setLayout(layout); + selectRadio(groupBox, 0); + + return groupBox; +} + +QGroupBox *DataSerieDialog::columnCountSelector() +{ + QVBoxLayout *layout = new QVBoxLayout(); + + QRadioButton *radio = new QRadioButton("1"); + radio->setChecked(true); + layout->addWidget(radio); + layout->addWidget(new QRadioButton("2")); + layout->addWidget(new QRadioButton("3")); + layout->addWidget(new QRadioButton("4")); + layout->addWidget(new QRadioButton("5")); + layout->addWidget(new QRadioButton("8")); + layout->addWidget(new QRadioButton("10")); + layout->addWidget(new QRadioButton("100")); + + QGroupBox *groupBox = new QGroupBox("Column count"); + groupBox->setLayout(layout); + selectRadio(groupBox, 0); + + return groupBox; +} + +QGroupBox *DataSerieDialog::rowCountSelector() +{ + QVBoxLayout *layout = new QVBoxLayout(); + + layout->addWidget(new QRadioButton("1")); + QRadioButton *radio = new QRadioButton("10"); + radio->setChecked(true); + layout->addWidget(radio); + layout->addWidget(new QRadioButton("50")); + layout->addWidget(new QRadioButton("100")); + layout->addWidget(new QRadioButton("1000")); + layout->addWidget(new QRadioButton("10000")); + layout->addWidget(new QRadioButton("100000")); + layout->addWidget(new QRadioButton("1000000")); + + QGroupBox *groupBox = new QGroupBox("Row count"); + groupBox->setLayout(layout); + selectRadio(groupBox, 0); + + return groupBox; +} + +QGroupBox *DataSerieDialog::dataCharacteristicsSelector() +{ + QVBoxLayout *layout = new QVBoxLayout(); + + layout->addWidget(new QRadioButton("Linear")); + layout->addWidget(new QRadioButton("Constant")); + layout->addWidget(new QRadioButton("Random")); + layout->addWidget(new QRadioButton("Sin")); + layout->addWidget(new QRadioButton("Sin + random")); + + QGroupBox *groupBox = new QGroupBox("Data Characteristics"); + groupBox->setLayout(layout); + selectRadio(groupBox, 0); + + return groupBox; +} + +void DataSerieDialog::accept() +{ + accepted(radioSelection(m_seriesTypeSelector), + radioSelection(m_columnCountSelector).toInt(), + radioSelection(m_rowCountSelector).toInt(), + radioSelection(m_dataCharacteristicsSelector), + m_labelsSelector->isChecked()); + QDialog::accept(); +} + +void DataSerieDialog::selectRadio(QGroupBox *groupBox, int defaultSelection) +{ + QVBoxLayout *layout = qobject_cast(groupBox->layout()); + Q_ASSERT(layout); + Q_ASSERT(layout->count()); + + QLayoutItem *item = 0; + if (defaultSelection == -1) { + item = layout->itemAt(0); + } else if (layout->count() > defaultSelection) { + item = layout->itemAt(defaultSelection); + } + Q_ASSERT(item); + QRadioButton *radio = qobject_cast(item->widget()); + Q_ASSERT(radio); + radio->setChecked(true); +} + +QString DataSerieDialog::radioSelection(QGroupBox *groupBox) +{ + QString selection; + QVBoxLayout *layout = qobject_cast(groupBox->layout()); + Q_ASSERT(layout); + + for (int i(0); i < layout->count(); i++) { + QLayoutItem *item = layout->itemAt(i); + Q_ASSERT(item); + QRadioButton *radio = qobject_cast(item->widget()); + Q_ASSERT(radio); + if (radio->isChecked()) { + selection = radio->text(); + break; + } + } + + qDebug() << "radioSelection: " << selection; + return selection; +} diff --git a/tests/chartwidgettest/dataseriedialog.h b/tests/manual/chartwidgettest/dataseriedialog.h similarity index 100% rename from tests/chartwidgettest/dataseriedialog.h rename to tests/manual/chartwidgettest/dataseriedialog.h index 9fc8cf7..5c0ee48 100644 --- a/tests/chartwidgettest/dataseriedialog.h +++ b/tests/manual/chartwidgettest/dataseriedialog.h @@ -1,55 +1,55 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DATASERIEDIALOG_H -#define DATASERIEDIALOG_H - -#include - -class QGroupBox; -class QCheckBox; - -class DataSerieDialog : public QDialog -{ - Q_OBJECT -public: - explicit DataSerieDialog(QWidget *parent = 0); - -signals: - void accepted(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsDefined); - -public slots: - void accept(); - -private: - QGroupBox *seriesTypeSelector(); - QGroupBox *columnCountSelector(); - QGroupBox *rowCountSelector(); - QGroupBox *dataCharacteristicsSelector(); - void selectRadio(QGroupBox *groupBox, int defaultSelection); - QString radioSelection(QGroupBox *groupBox); - QGroupBox *m_seriesTypeSelector; - QGroupBox *m_columnCountSelector; - QGroupBox *m_rowCountSelector; - QCheckBox *m_labelsSelector; - QGroupBox *m_dataCharacteristicsSelector; -}; - -#endif // DATASERIEDIALOG_H +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DATASERIEDIALOG_H +#define DATASERIEDIALOG_H + +#include + +class QGroupBox; +class QCheckBox; + +class DataSerieDialog : public QDialog +{ + Q_OBJECT +public: + explicit DataSerieDialog(QWidget *parent = 0); + +signals: + void accepted(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsDefined); + +public slots: + void accept(); + +private: + QGroupBox *seriesTypeSelector(); + QGroupBox *columnCountSelector(); + QGroupBox *rowCountSelector(); + QGroupBox *dataCharacteristicsSelector(); + void selectRadio(QGroupBox *groupBox, int defaultSelection); + QString radioSelection(QGroupBox *groupBox); + QGroupBox *m_seriesTypeSelector; + QGroupBox *m_columnCountSelector; + QGroupBox *m_rowCountSelector; + QCheckBox *m_labelsSelector; + QGroupBox *m_dataCharacteristicsSelector; +}; + +#endif // DATASERIEDIALOG_H diff --git a/tests/chartwidgettest/main.cpp b/tests/manual/chartwidgettest/main.cpp similarity index 100% rename from tests/chartwidgettest/main.cpp rename to tests/manual/chartwidgettest/main.cpp diff --git a/tests/chartwidgettest/mainwidget.cpp b/tests/manual/chartwidgettest/mainwidget.cpp similarity index 100% rename from tests/chartwidgettest/mainwidget.cpp rename to tests/manual/chartwidgettest/mainwidget.cpp index eb263f9..97b1e79 100644 --- a/tests/chartwidgettest/mainwidget.cpp +++ b/tests/manual/chartwidgettest/mainwidget.cpp @@ -1,380 +1,380 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwidget.h" -#include "dataseriedialog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_CHARTS_USE_NAMESPACE - -MainWidget::MainWidget(QWidget *parent) : - QWidget(parent), - m_addSerieDialog(0), - m_chart(0) -{ - m_chart = new QChart(); - - // Grid layout for the controls for configuring the chart widget - QGridLayout *grid = new QGridLayout(); - QPushButton *addSeriesButton = new QPushButton("Add series"); - connect(addSeriesButton, SIGNAL(clicked()), this, SLOT(addSeries())); - grid->addWidget(addSeriesButton, 0, 1); - initBackroundCombo(grid); - initScaleControls(grid); - initThemeCombo(grid); - initCheckboxes(grid); - - // add row with empty label to make all the other rows static - grid->addWidget(new QLabel(""), grid->rowCount(), 0); - grid->setRowStretch(grid->rowCount() - 1, 1); - - // Create chart view with the chart - m_chartView = new QChartView(m_chart, this); - m_chartView->setRubberBand(QChartView::HorizonalRubberBand); - - // Another grid layout as a main layout - QGridLayout *mainLayout = new QGridLayout(); - mainLayout->addLayout(grid, 0, 0); - mainLayout->addWidget(m_chartView, 0, 1, 3, 1); - setLayout(mainLayout); -} - -// Combo box for selecting the chart's background -void MainWidget::initBackroundCombo(QGridLayout *grid) -{ - QComboBox *backgroundCombo = new QComboBox(this); - backgroundCombo->addItem("Color"); - backgroundCombo->addItem("Gradient"); - backgroundCombo->addItem("Image"); - connect(backgroundCombo, SIGNAL(currentIndexChanged(int)), - this, SLOT(backgroundChanged(int))); - - grid->addWidget(new QLabel("Background:"), grid->rowCount(), 0); - grid->addWidget(backgroundCombo, grid->rowCount() - 1, 1); -} - -// Scale related controls (auto-scale vs. manual min-max values) -void MainWidget::initScaleControls(QGridLayout *grid) -{ - m_autoScaleCheck = new QCheckBox("Automatic scaling"); - connect(m_autoScaleCheck, SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int))); - // Allow setting also non-sense values (like -2147483648 and 2147483647) - m_xMinSpin = new QSpinBox(); - m_xMinSpin->setMinimum(INT_MIN); - m_xMinSpin->setMaximum(INT_MAX); - m_xMinSpin->setValue(0); - connect(m_xMinSpin, SIGNAL(valueChanged(int)), this, SLOT(xMinChanged(int))); - m_xMaxSpin = new QSpinBox(); - m_xMaxSpin->setMinimum(INT_MIN); - m_xMaxSpin->setMaximum(INT_MAX); - m_xMaxSpin->setValue(10); - connect(m_xMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(xMaxChanged(int))); - m_yMinSpin = new QSpinBox(); - m_yMinSpin->setMinimum(INT_MIN); - m_yMinSpin->setMaximum(INT_MAX); - m_yMinSpin->setValue(0); - connect(m_yMinSpin, SIGNAL(valueChanged(int)), this, SLOT(yMinChanged(int))); - m_yMaxSpin = new QSpinBox(); - m_yMaxSpin->setMinimum(INT_MIN); - m_yMaxSpin->setMaximum(INT_MAX); - m_yMaxSpin->setValue(10); - connect(m_yMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(yMaxChanged(int))); - - grid->addWidget(m_autoScaleCheck, grid->rowCount(), 0); - grid->addWidget(new QLabel("x min:"), grid->rowCount(), 0); - grid->addWidget(m_xMinSpin, grid->rowCount() - 1, 1); - grid->addWidget(new QLabel("x max:"), grid->rowCount(), 0); - grid->addWidget(m_xMaxSpin, grid->rowCount() - 1, 1); - grid->addWidget(new QLabel("y min:"), grid->rowCount(), 0); - grid->addWidget(m_yMinSpin, grid->rowCount() - 1, 1); - grid->addWidget(new QLabel("y max:"), grid->rowCount(), 0); - grid->addWidget(m_yMaxSpin, grid->rowCount() - 1, 1); - - m_autoScaleCheck->setChecked(true); -} - -// Combo box for selecting theme -void MainWidget::initThemeCombo(QGridLayout *grid) -{ - QComboBox *chartTheme = new QComboBox(); - chartTheme->addItem("Default"); - chartTheme->addItem("Light"); - chartTheme->addItem("Blue Cerulean"); - chartTheme->addItem("Dark"); - chartTheme->addItem("Brown Sand"); - chartTheme->addItem("Blue NCS"); - chartTheme->addItem("High Contrast"); - chartTheme->addItem("Blue Icy"); - chartTheme->addItem("Qt"); - connect(chartTheme, SIGNAL(currentIndexChanged(int)), - this, SLOT(changeChartTheme(int))); - grid->addWidget(new QLabel("Chart theme:"), 8, 0); - grid->addWidget(chartTheme, 8, 1); -} - -// Different check boxes for customizing chart -void MainWidget::initCheckboxes(QGridLayout *grid) -{ - // TODO: setZoomEnabled slot has been removed from QChartView -> Re-implement zoom on/off - QCheckBox *zoomCheckBox = new QCheckBox("Drag'n drop Zoom"); -// connect(zoomCheckBox, SIGNAL(toggled(bool)), m_chartView, SLOT(setZoomEnabled(bool))); - zoomCheckBox->setChecked(true); - grid->addWidget(zoomCheckBox, grid->rowCount(), 0); - - QCheckBox *aliasCheckBox = new QCheckBox("Anti-alias"); - connect(aliasCheckBox, SIGNAL(toggled(bool)), this, SLOT(antiAliasToggled(bool))); - aliasCheckBox->setChecked(false); - grid->addWidget(aliasCheckBox, grid->rowCount(), 0); - - QCheckBox *openGLCheckBox = new QCheckBox("Use QGLWidget"); - connect(openGLCheckBox, SIGNAL(toggled(bool)), this, SLOT(openGLToggled(bool))); - openGLCheckBox->setChecked(false); - grid->addWidget(openGLCheckBox, grid->rowCount(), 0); -} - -void MainWidget::antiAliasToggled(bool enabled) -{ - m_chartView->setRenderHint(QPainter::Antialiasing, enabled); -} - -void MainWidget::openGLToggled(bool enabled) -{ - if (enabled) { - QGLFormat f = QGLFormat::defaultFormat(); - f.setSampleBuffers(true); - f.setSamples(4); - QGLFormat::setDefaultFormat(f); - QGLWidget *g = new QGLWidget(); - m_chartView->setViewport(g); - } else { - m_chartView->setViewport(0); - } -} - -void MainWidget::addSeries() -{ - if (!m_addSerieDialog) { - m_addSerieDialog = new DataSerieDialog(this); - connect(m_addSerieDialog, SIGNAL(accepted(QString,int,int,QString,bool)), - this, SLOT(addSeries(QString,int,int,QString,bool))); - } - m_addSerieDialog->exec(); -} - -QList MainWidget::generateTestData(int columnCount, int rowCount, QString dataCharacteristics) -{ - QList testData; - for (int j(0); j < columnCount; j++) { - QList newColumn; - for (int i(0); i < rowCount; i++) { - if (dataCharacteristics == "Sin") { - newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); - } else if (dataCharacteristics == "Sin + random") { - newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); - } else if (dataCharacteristics == "Random") { - newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); - } else if (dataCharacteristics == "Linear") { - //newColumn.append(i * (j + 1.0)); - // TODO: temporary hack to make pie work; prevent zero values: - newColumn.append(i * (j + 1.0) + 0.1); - } else { // "constant" - newColumn.append((j + 1.0)); - } - } - testData.append(newColumn); - } - return testData; -} - -QStringList MainWidget::generateLabels(int count) -{ - QStringList result; - for (int i(0); i < count; i++) - result.append("label" + QString::number(i)); - return result; -} - -void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled) -{ - qDebug() << "addSeries: " << seriesName - << " columnCount: " << columnCount - << " rowCount: " << rowCount - << " dataCharacteristics: " << dataCharacteristics - << " labels enabled: " << labelsEnabled; - m_defaultSeriesName = seriesName; - - QList data = generateTestData(columnCount, rowCount, dataCharacteristics); - - // Line series and scatter series use similar data - if (seriesName == "Line") { - for (int j(0); j < data.count(); j ++) { - QList column = data.at(j); - QLineSeries *series = new QLineSeries(); - series->setName("line" + QString::number(j)); - for (int i(0); i < column.count(); i++) - series->append(i, column.at(i)); - m_chart->addSeries(series); - } - } else if (seriesName == "Area") { - // TODO: lower series for the area? - for (int j(0); j < data.count(); j ++) { - QList column = data.at(j); - QLineSeries *lineSeries = new QLineSeries(); - for (int i(0); i < column.count(); i++) - lineSeries->append(i, column.at(i)); - QAreaSeries *areaSeries = new QAreaSeries(lineSeries); - areaSeries->setName("area" + QString::number(j)); - m_chart->addSeries(areaSeries); - } - } else if (seriesName == "Scatter") { - for (int j(0); j < data.count(); j++) { - QList column = data.at(j); - QScatterSeries *series = new QScatterSeries(); - series->setName("scatter" + QString::number(j)); - for (int i(0); i < column.count(); i++) - series->append(i, column.at(i)); - m_chart->addSeries(series); - } - } else if (seriesName == "Pie") { - QStringList labels = generateLabels(rowCount); - for (int j(0); j < data.count(); j++) { - QPieSeries *series = new QPieSeries(); - QList column = data.at(j); - for (int i(0); i < column.count(); i++) - series->append(labels.at(i), column.at(i)); - m_chart->addSeries(series); - } - } else if (seriesName == "Bar" - || seriesName == "Stacked bar" - || seriesName == "Percent bar") { - QStringList category; - QStringList labels = generateLabels(rowCount); - foreach (QString label, labels) - category << label; - QAbstractBarSeries* series = 0; - if (seriesName == "Bar") { - series = new QBarSeries(this); - QBarCategoryAxis* axis = new QBarCategoryAxis(); - axis->append(category); - m_chart->setAxisX(axis,series); - } else if (seriesName == "Stacked bar") { - series = new QStackedBarSeries(this); - QBarCategoryAxis* axis = new QBarCategoryAxis(); - axis->append(category); - m_chart->setAxisX(axis,series); - } else { - series = new QPercentBarSeries(this); - QBarCategoryAxis* axis = new QBarCategoryAxis(); - axis->append(category); - m_chart->setAxisX(axis,series); - } - - for (int j(0); j < data.count(); j++) { - QList column = data.at(j); - QBarSet *set = new QBarSet("set" + QString::number(j)); - for (int i(0); i < column.count(); i++) - *set << column.at(i); - series->append(set); - } - - m_chart->addSeries(series); - } else if (seriesName == "Spline") { - for (int j(0); j < data.count(); j ++) { - QList column = data.at(j); - QSplineSeries *series = new QSplineSeries(); - series->setName("spline" + QString::number(j)); - for (int i(0); i < column.count(); i++) - series->append(i, column.at(i)); - m_chart->addSeries(series); - } - } - m_chart->createDefaultAxes(); -} - -void MainWidget::backgroundChanged(int itemIndex) -{ - qDebug() << "backgroundChanged: " << itemIndex; -} - -void MainWidget::autoScaleChanged(int value) -{ - if (value) { - // TODO: enable auto scaling - } else { - // TODO: set scaling manually (and disable auto scaling) - } - - m_xMinSpin->setEnabled(!value); - m_xMaxSpin->setEnabled(!value); - m_yMinSpin->setEnabled(!value); - m_yMaxSpin->setEnabled(!value); -} - -void MainWidget::xMinChanged(int value) -{ - qDebug() << "xMinChanged: " << value; -} - -void MainWidget::xMaxChanged(int value) -{ - qDebug() << "xMaxChanged: " << value; -} - -void MainWidget::yMinChanged(int value) -{ - qDebug() << "yMinChanged: " << value; -} - -void MainWidget::yMaxChanged(int value) -{ - qDebug() << "yMaxChanged: " << value; -} - -void MainWidget::changeChartTheme(int themeIndex) -{ - qDebug() << "changeChartTheme: " << themeIndex; - if (themeIndex == 0) - m_chart->setTheme(QChart::ChartThemeLight); - else - m_chart->setTheme((QChart::ChartTheme) (themeIndex - 1)); -} +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "mainwidget.h" +#include "dataseriedialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_CHARTS_USE_NAMESPACE + +MainWidget::MainWidget(QWidget *parent) : + QWidget(parent), + m_addSerieDialog(0), + m_chart(0) +{ + m_chart = new QChart(); + + // Grid layout for the controls for configuring the chart widget + QGridLayout *grid = new QGridLayout(); + QPushButton *addSeriesButton = new QPushButton("Add series"); + connect(addSeriesButton, SIGNAL(clicked()), this, SLOT(addSeries())); + grid->addWidget(addSeriesButton, 0, 1); + initBackroundCombo(grid); + initScaleControls(grid); + initThemeCombo(grid); + initCheckboxes(grid); + + // add row with empty label to make all the other rows static + grid->addWidget(new QLabel(""), grid->rowCount(), 0); + grid->setRowStretch(grid->rowCount() - 1, 1); + + // Create chart view with the chart + m_chartView = new QChartView(m_chart, this); + m_chartView->setRubberBand(QChartView::HorizonalRubberBand); + + // Another grid layout as a main layout + QGridLayout *mainLayout = new QGridLayout(); + mainLayout->addLayout(grid, 0, 0); + mainLayout->addWidget(m_chartView, 0, 1, 3, 1); + setLayout(mainLayout); +} + +// Combo box for selecting the chart's background +void MainWidget::initBackroundCombo(QGridLayout *grid) +{ + QComboBox *backgroundCombo = new QComboBox(this); + backgroundCombo->addItem("Color"); + backgroundCombo->addItem("Gradient"); + backgroundCombo->addItem("Image"); + connect(backgroundCombo, SIGNAL(currentIndexChanged(int)), + this, SLOT(backgroundChanged(int))); + + grid->addWidget(new QLabel("Background:"), grid->rowCount(), 0); + grid->addWidget(backgroundCombo, grid->rowCount() - 1, 1); +} + +// Scale related controls (auto-scale vs. manual min-max values) +void MainWidget::initScaleControls(QGridLayout *grid) +{ + m_autoScaleCheck = new QCheckBox("Automatic scaling"); + connect(m_autoScaleCheck, SIGNAL(stateChanged(int)), this, SLOT(autoScaleChanged(int))); + // Allow setting also non-sense values (like -2147483648 and 2147483647) + m_xMinSpin = new QSpinBox(); + m_xMinSpin->setMinimum(INT_MIN); + m_xMinSpin->setMaximum(INT_MAX); + m_xMinSpin->setValue(0); + connect(m_xMinSpin, SIGNAL(valueChanged(int)), this, SLOT(xMinChanged(int))); + m_xMaxSpin = new QSpinBox(); + m_xMaxSpin->setMinimum(INT_MIN); + m_xMaxSpin->setMaximum(INT_MAX); + m_xMaxSpin->setValue(10); + connect(m_xMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(xMaxChanged(int))); + m_yMinSpin = new QSpinBox(); + m_yMinSpin->setMinimum(INT_MIN); + m_yMinSpin->setMaximum(INT_MAX); + m_yMinSpin->setValue(0); + connect(m_yMinSpin, SIGNAL(valueChanged(int)), this, SLOT(yMinChanged(int))); + m_yMaxSpin = new QSpinBox(); + m_yMaxSpin->setMinimum(INT_MIN); + m_yMaxSpin->setMaximum(INT_MAX); + m_yMaxSpin->setValue(10); + connect(m_yMaxSpin, SIGNAL(valueChanged(int)), this, SLOT(yMaxChanged(int))); + + grid->addWidget(m_autoScaleCheck, grid->rowCount(), 0); + grid->addWidget(new QLabel("x min:"), grid->rowCount(), 0); + grid->addWidget(m_xMinSpin, grid->rowCount() - 1, 1); + grid->addWidget(new QLabel("x max:"), grid->rowCount(), 0); + grid->addWidget(m_xMaxSpin, grid->rowCount() - 1, 1); + grid->addWidget(new QLabel("y min:"), grid->rowCount(), 0); + grid->addWidget(m_yMinSpin, grid->rowCount() - 1, 1); + grid->addWidget(new QLabel("y max:"), grid->rowCount(), 0); + grid->addWidget(m_yMaxSpin, grid->rowCount() - 1, 1); + + m_autoScaleCheck->setChecked(true); +} + +// Combo box for selecting theme +void MainWidget::initThemeCombo(QGridLayout *grid) +{ + QComboBox *chartTheme = new QComboBox(); + chartTheme->addItem("Default"); + chartTheme->addItem("Light"); + chartTheme->addItem("Blue Cerulean"); + chartTheme->addItem("Dark"); + chartTheme->addItem("Brown Sand"); + chartTheme->addItem("Blue NCS"); + chartTheme->addItem("High Contrast"); + chartTheme->addItem("Blue Icy"); + chartTheme->addItem("Qt"); + connect(chartTheme, SIGNAL(currentIndexChanged(int)), + this, SLOT(changeChartTheme(int))); + grid->addWidget(new QLabel("Chart theme:"), 8, 0); + grid->addWidget(chartTheme, 8, 1); +} + +// Different check boxes for customizing chart +void MainWidget::initCheckboxes(QGridLayout *grid) +{ + // TODO: setZoomEnabled slot has been removed from QChartView -> Re-implement zoom on/off + QCheckBox *zoomCheckBox = new QCheckBox("Drag'n drop Zoom"); +// connect(zoomCheckBox, SIGNAL(toggled(bool)), m_chartView, SLOT(setZoomEnabled(bool))); + zoomCheckBox->setChecked(true); + grid->addWidget(zoomCheckBox, grid->rowCount(), 0); + + QCheckBox *aliasCheckBox = new QCheckBox("Anti-alias"); + connect(aliasCheckBox, SIGNAL(toggled(bool)), this, SLOT(antiAliasToggled(bool))); + aliasCheckBox->setChecked(false); + grid->addWidget(aliasCheckBox, grid->rowCount(), 0); + + QCheckBox *openGLCheckBox = new QCheckBox("Use QGLWidget"); + connect(openGLCheckBox, SIGNAL(toggled(bool)), this, SLOT(openGLToggled(bool))); + openGLCheckBox->setChecked(false); + grid->addWidget(openGLCheckBox, grid->rowCount(), 0); +} + +void MainWidget::antiAliasToggled(bool enabled) +{ + m_chartView->setRenderHint(QPainter::Antialiasing, enabled); +} + +void MainWidget::openGLToggled(bool enabled) +{ + if (enabled) { + QGLFormat f = QGLFormat::defaultFormat(); + f.setSampleBuffers(true); + f.setSamples(4); + QGLFormat::setDefaultFormat(f); + QGLWidget *g = new QGLWidget(); + m_chartView->setViewport(g); + } else { + m_chartView->setViewport(0); + } +} + +void MainWidget::addSeries() +{ + if (!m_addSerieDialog) { + m_addSerieDialog = new DataSerieDialog(this); + connect(m_addSerieDialog, SIGNAL(accepted(QString,int,int,QString,bool)), + this, SLOT(addSeries(QString,int,int,QString,bool))); + } + m_addSerieDialog->exec(); +} + +QList MainWidget::generateTestData(int columnCount, int rowCount, QString dataCharacteristics) +{ + QList testData; + for (int j(0); j < columnCount; j++) { + QList newColumn; + for (int i(0); i < rowCount; i++) { + if (dataCharacteristics == "Sin") { + newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); + } else if (dataCharacteristics == "Sin + random") { + newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); + } else if (dataCharacteristics == "Random") { + newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); + } else if (dataCharacteristics == "Linear") { + //newColumn.append(i * (j + 1.0)); + // TODO: temporary hack to make pie work; prevent zero values: + newColumn.append(i * (j + 1.0) + 0.1); + } else { // "constant" + newColumn.append((j + 1.0)); + } + } + testData.append(newColumn); + } + return testData; +} + +QStringList MainWidget::generateLabels(int count) +{ + QStringList result; + for (int i(0); i < count; i++) + result.append("label" + QString::number(i)); + return result; +} + +void MainWidget::addSeries(QString seriesName, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled) +{ + qDebug() << "addSeries: " << seriesName + << " columnCount: " << columnCount + << " rowCount: " << rowCount + << " dataCharacteristics: " << dataCharacteristics + << " labels enabled: " << labelsEnabled; + m_defaultSeriesName = seriesName; + + QList data = generateTestData(columnCount, rowCount, dataCharacteristics); + + // Line series and scatter series use similar data + if (seriesName == "Line") { + for (int j(0); j < data.count(); j ++) { + QList column = data.at(j); + QLineSeries *series = new QLineSeries(); + series->setName("line" + QString::number(j)); + for (int i(0); i < column.count(); i++) + series->append(i, column.at(i)); + m_chart->addSeries(series); + } + } else if (seriesName == "Area") { + // TODO: lower series for the area? + for (int j(0); j < data.count(); j ++) { + QList column = data.at(j); + QLineSeries *lineSeries = new QLineSeries(); + for (int i(0); i < column.count(); i++) + lineSeries->append(i, column.at(i)); + QAreaSeries *areaSeries = new QAreaSeries(lineSeries); + areaSeries->setName("area" + QString::number(j)); + m_chart->addSeries(areaSeries); + } + } else if (seriesName == "Scatter") { + for (int j(0); j < data.count(); j++) { + QList column = data.at(j); + QScatterSeries *series = new QScatterSeries(); + series->setName("scatter" + QString::number(j)); + for (int i(0); i < column.count(); i++) + series->append(i, column.at(i)); + m_chart->addSeries(series); + } + } else if (seriesName == "Pie") { + QStringList labels = generateLabels(rowCount); + for (int j(0); j < data.count(); j++) { + QPieSeries *series = new QPieSeries(); + QList column = data.at(j); + for (int i(0); i < column.count(); i++) + series->append(labels.at(i), column.at(i)); + m_chart->addSeries(series); + } + } else if (seriesName == "Bar" + || seriesName == "Stacked bar" + || seriesName == "Percent bar") { + QStringList category; + QStringList labels = generateLabels(rowCount); + foreach (QString label, labels) + category << label; + QAbstractBarSeries* series = 0; + if (seriesName == "Bar") { + series = new QBarSeries(this); + QBarCategoryAxis* axis = new QBarCategoryAxis(); + axis->append(category); + m_chart->setAxisX(axis,series); + } else if (seriesName == "Stacked bar") { + series = new QStackedBarSeries(this); + QBarCategoryAxis* axis = new QBarCategoryAxis(); + axis->append(category); + m_chart->setAxisX(axis,series); + } else { + series = new QPercentBarSeries(this); + QBarCategoryAxis* axis = new QBarCategoryAxis(); + axis->append(category); + m_chart->setAxisX(axis,series); + } + + for (int j(0); j < data.count(); j++) { + QList column = data.at(j); + QBarSet *set = new QBarSet("set" + QString::number(j)); + for (int i(0); i < column.count(); i++) + *set << column.at(i); + series->append(set); + } + + m_chart->addSeries(series); + } else if (seriesName == "Spline") { + for (int j(0); j < data.count(); j ++) { + QList column = data.at(j); + QSplineSeries *series = new QSplineSeries(); + series->setName("spline" + QString::number(j)); + for (int i(0); i < column.count(); i++) + series->append(i, column.at(i)); + m_chart->addSeries(series); + } + } + m_chart->createDefaultAxes(); +} + +void MainWidget::backgroundChanged(int itemIndex) +{ + qDebug() << "backgroundChanged: " << itemIndex; +} + +void MainWidget::autoScaleChanged(int value) +{ + if (value) { + // TODO: enable auto scaling + } else { + // TODO: set scaling manually (and disable auto scaling) + } + + m_xMinSpin->setEnabled(!value); + m_xMaxSpin->setEnabled(!value); + m_yMinSpin->setEnabled(!value); + m_yMaxSpin->setEnabled(!value); +} + +void MainWidget::xMinChanged(int value) +{ + qDebug() << "xMinChanged: " << value; +} + +void MainWidget::xMaxChanged(int value) +{ + qDebug() << "xMaxChanged: " << value; +} + +void MainWidget::yMinChanged(int value) +{ + qDebug() << "yMinChanged: " << value; +} + +void MainWidget::yMaxChanged(int value) +{ + qDebug() << "yMaxChanged: " << value; +} + +void MainWidget::changeChartTheme(int themeIndex) +{ + qDebug() << "changeChartTheme: " << themeIndex; + if (themeIndex == 0) + m_chart->setTheme(QChart::ChartThemeLight); + else + m_chart->setTheme((QChart::ChartTheme) (themeIndex - 1)); +} diff --git a/tests/chartwidgettest/mainwidget.h b/tests/manual/chartwidgettest/mainwidget.h similarity index 100% rename from tests/chartwidgettest/mainwidget.h rename to tests/manual/chartwidgettest/mainwidget.h index 4549c0d..82a710b 100644 --- a/tests/chartwidgettest/mainwidget.h +++ b/tests/manual/chartwidgettest/mainwidget.h @@ -1,80 +1,80 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Enterprise Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWIDGET_H -#define MAINWIDGET_H - -#include -#include -#include -#include - -class QSpinBox; -class QCheckBox; -class QGridLayout; - -QT_CHARTS_USE_NAMESPACE - -#define RealList QList -class DataSerieDialog; - -class MainWidget : public QWidget -{ - Q_OBJECT -public: - explicit MainWidget(QWidget *parent = 0); - -signals: - -private: - void initBackroundCombo(QGridLayout *grid); - void initScaleControls(QGridLayout *grid); - void initThemeCombo(QGridLayout *grid); - void initCheckboxes(QGridLayout *grid); - -private slots: - void addSeries(); - void addSeries(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled); - void backgroundChanged(int itemIndex); - void autoScaleChanged(int value); - void xMinChanged(int value); - void xMaxChanged(int value); - void yMinChanged(int value); - void yMaxChanged(int value); - void antiAliasToggled(bool enabled); - void openGLToggled(bool enabled); - void changeChartTheme(int themeIndex); - QList generateTestData(int columnCount, int rowCount, QString dataCharacteristics); - QStringList generateLabels(int count); - -private: - DataSerieDialog *m_addSerieDialog; - QChart *m_chart; - QChartView *m_chartView; - QCheckBox *m_autoScaleCheck; - QSpinBox *m_xMinSpin; - QSpinBox *m_xMaxSpin; - QSpinBox *m_yMinSpin; - QSpinBox *m_yMaxSpin; - QString m_defaultSeriesName; - QGridLayout *m_scatterLayout; -}; - -#endif // MAINWIDGET_H +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MAINWIDGET_H +#define MAINWIDGET_H + +#include +#include +#include +#include + +class QSpinBox; +class QCheckBox; +class QGridLayout; + +QT_CHARTS_USE_NAMESPACE + +#define RealList QList +class DataSerieDialog; + +class MainWidget : public QWidget +{ + Q_OBJECT +public: + explicit MainWidget(QWidget *parent = 0); + +signals: + +private: + void initBackroundCombo(QGridLayout *grid); + void initScaleControls(QGridLayout *grid); + void initThemeCombo(QGridLayout *grid); + void initCheckboxes(QGridLayout *grid); + +private slots: + void addSeries(); + void addSeries(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled); + void backgroundChanged(int itemIndex); + void autoScaleChanged(int value); + void xMinChanged(int value); + void xMaxChanged(int value); + void yMinChanged(int value); + void yMaxChanged(int value); + void antiAliasToggled(bool enabled); + void openGLToggled(bool enabled); + void changeChartTheme(int themeIndex); + QList generateTestData(int columnCount, int rowCount, QString dataCharacteristics); + QStringList generateLabels(int count); + +private: + DataSerieDialog *m_addSerieDialog; + QChart *m_chart; + QChartView *m_chartView; + QCheckBox *m_autoScaleCheck; + QSpinBox *m_xMinSpin; + QSpinBox *m_xMaxSpin; + QSpinBox *m_yMinSpin; + QSpinBox *m_yMaxSpin; + QString m_defaultSeriesName; + QGridLayout *m_scatterLayout; +}; + +#endif // MAINWIDGET_H diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro new file mode 100644 index 0000000..5f2b85b --- /dev/null +++ b/tests/manual/manual.pro @@ -0,0 +1,18 @@ +TEMPLATE = subdirs +SUBDIRS += \ + presenterchart \ + polarcharttest \ + boxplottester + +contains(QT_CONFIG, opengl) { + SUBDIRS += chartwidgettest \ + wavechart \ + chartviewer +} else { + message("OpenGL not available. Some test apps are disabled") +} + +qtHaveModule(quick) { + SUBDIRS += qmlchartproperties \ + qmlchartaxis +} diff --git a/tests/polarcharttest/chartview.cpp b/tests/manual/polarcharttest/chartview.cpp similarity index 100% rename from tests/polarcharttest/chartview.cpp rename to tests/manual/polarcharttest/chartview.cpp diff --git a/tests/polarcharttest/chartview.h b/tests/manual/polarcharttest/chartview.h similarity index 100% rename from tests/polarcharttest/chartview.h rename to tests/manual/polarcharttest/chartview.h diff --git a/tests/polarcharttest/main.cpp b/tests/manual/polarcharttest/main.cpp similarity index 100% rename from tests/polarcharttest/main.cpp rename to tests/manual/polarcharttest/main.cpp diff --git a/tests/polarcharttest/mainwindow.cpp b/tests/manual/polarcharttest/mainwindow.cpp similarity index 100% rename from tests/polarcharttest/mainwindow.cpp rename to tests/manual/polarcharttest/mainwindow.cpp diff --git a/tests/polarcharttest/mainwindow.h b/tests/manual/polarcharttest/mainwindow.h similarity index 100% rename from tests/polarcharttest/mainwindow.h rename to tests/manual/polarcharttest/mainwindow.h diff --git a/tests/polarcharttest/mainwindow.ui b/tests/manual/polarcharttest/mainwindow.ui similarity index 100% rename from tests/polarcharttest/mainwindow.ui rename to tests/manual/polarcharttest/mainwindow.ui diff --git a/tests/polarcharttest/polarcharttest.pro b/tests/manual/polarcharttest/polarcharttest.pro similarity index 92% rename from tests/polarcharttest/polarcharttest.pro rename to tests/manual/polarcharttest/polarcharttest.pro index 0c892c8..a840976 100644 --- a/tests/polarcharttest/polarcharttest.pro +++ b/tests/manual/polarcharttest/polarcharttest.pro @@ -1,4 +1,4 @@ -!include( ../tests.pri ) { +!include( ../../tests.pri ) { error( "Couldn't find the test.pri file!" ) } diff --git a/tests/presenterchart/chartview.cpp b/tests/manual/presenterchart/chartview.cpp similarity index 100% rename from tests/presenterchart/chartview.cpp rename to tests/manual/presenterchart/chartview.cpp diff --git a/tests/presenterchart/chartview.h b/tests/manual/presenterchart/chartview.h similarity index 100% rename from tests/presenterchart/chartview.h rename to tests/manual/presenterchart/chartview.h diff --git a/tests/presenterchart/main.cpp b/tests/manual/presenterchart/main.cpp similarity index 100% rename from tests/presenterchart/main.cpp rename to tests/manual/presenterchart/main.cpp diff --git a/tests/presenterchart/presenterchart.pro b/tests/manual/presenterchart/presenterchart.pro similarity index 71% rename from tests/presenterchart/presenterchart.pro rename to tests/manual/presenterchart/presenterchart.pro index bd3367d..0269c6e 100644 --- a/tests/presenterchart/presenterchart.pro +++ b/tests/manual/presenterchart/presenterchart.pro @@ -1,6 +1,7 @@ -!include( ../tests.pri ) { - error( "Couldn't find the examples.pri file!" ) +!include( ../../tests.pri ) { + error( "Couldn't find the test.pri file!" ) } + TARGET = presenterchart HEADERS += chartview.h SOURCES += main.cpp chartview.cpp diff --git a/tests/qmlchartaxis/main.cpp b/tests/manual/qmlchartaxis/main.cpp similarity index 100% rename from tests/qmlchartaxis/main.cpp rename to tests/manual/qmlchartaxis/main.cpp diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/Button.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/Button.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/Button.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/Button.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxes.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/ChartAxesRevert.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/ConfiguringDynamically.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/CreatingDynamically.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAndUserDefined.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxes.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/DefaultAxesRevert.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/Legacy.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/Legacy.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/Legacy.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/Legacy.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/SeriesSpecificDynamic.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/SwitchingDynamically.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefined.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/UserDefinedRevert.qml diff --git a/tests/qmlchartaxis/qml/qmlchartaxis/main.qml b/tests/manual/qmlchartaxis/qml/qmlchartaxis/main.qml similarity index 100% rename from tests/qmlchartaxis/qml/qmlchartaxis/main.qml rename to tests/manual/qmlchartaxis/qml/qmlchartaxis/main.qml diff --git a/tests/qmlchartaxis/qmlchartaxis.pro b/tests/manual/qmlchartaxis/qmlchartaxis.pro similarity index 83% rename from tests/qmlchartaxis/qmlchartaxis.pro rename to tests/manual/qmlchartaxis/qmlchartaxis.pro index 0abc1d4..aaf2a7a 100644 --- a/tests/qmlchartaxis/qmlchartaxis.pro +++ b/tests/manual/qmlchartaxis/qmlchartaxis.pro @@ -1,4 +1,4 @@ -!include( ../tests.pri ) { +!include( ../../tests.pri ) { error( "Couldn't find the test.pri file!" ) } diff --git a/tests/qmlchartaxis/resources.qrc b/tests/manual/qmlchartaxis/resources.qrc similarity index 100% rename from tests/qmlchartaxis/resources.qrc rename to tests/manual/qmlchartaxis/resources.qrc diff --git a/tests/qmlchartproperties/main.cpp b/tests/manual/qmlchartproperties/main.cpp similarity index 100% rename from tests/qmlchartproperties/main.cpp rename to tests/manual/qmlchartproperties/main.cpp diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/AreaEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/BarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/BarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/BarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/BarEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/Button.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Button.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/Button.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/Button.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/Chart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/Chart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/Chart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorAxis.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorProperties.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorTitle.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/FontEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalBarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalPercentBarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/HorizontalStackedBarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/LineChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/LineChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/LineChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/LineEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/PercentBarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/PieChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/PieChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/PieChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/PieEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/ScatterEditor.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/SplineChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/StackedBarChart.qml diff --git a/tests/qmlchartproperties/qml/qmlchartproperties/main.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/main.qml similarity index 100% rename from tests/qmlchartproperties/qml/qmlchartproperties/main.qml rename to tests/manual/qmlchartproperties/qml/qmlchartproperties/main.qml diff --git a/tests/qmlchartproperties/qmlchartproperties.pro b/tests/manual/qmlchartproperties/qmlchartproperties.pro similarity index 83% rename from tests/qmlchartproperties/qmlchartproperties.pro rename to tests/manual/qmlchartproperties/qmlchartproperties.pro index 6d148e8..78c1930 100644 --- a/tests/qmlchartproperties/qmlchartproperties.pro +++ b/tests/manual/qmlchartproperties/qmlchartproperties.pro @@ -1,4 +1,4 @@ -!include( ../tests.pri ) { +!include( ../../tests.pri ) { error( "Couldn't find the test.pri file!" ) } diff --git a/tests/qmlchartproperties/resources.qrc b/tests/manual/qmlchartproperties/resources.qrc similarity index 100% rename from tests/qmlchartproperties/resources.qrc rename to tests/manual/qmlchartproperties/resources.qrc diff --git a/tests/wavechart/main.cpp b/tests/manual/wavechart/main.cpp similarity index 100% rename from tests/wavechart/main.cpp rename to tests/manual/wavechart/main.cpp diff --git a/tests/wavechart/wavechart.cpp b/tests/manual/wavechart/wavechart.cpp similarity index 100% rename from tests/wavechart/wavechart.cpp rename to tests/manual/wavechart/wavechart.cpp diff --git a/tests/wavechart/wavechart.h b/tests/manual/wavechart/wavechart.h similarity index 100% rename from tests/wavechart/wavechart.h rename to tests/manual/wavechart/wavechart.h diff --git a/tests/wavechart/wavechart.pro b/tests/manual/wavechart/wavechart.pro similarity index 71% rename from tests/wavechart/wavechart.pro rename to tests/manual/wavechart/wavechart.pro index aed0c39..0da16ed 100644 --- a/tests/wavechart/wavechart.pro +++ b/tests/manual/wavechart/wavechart.pro @@ -1,6 +1,7 @@ -!include( ../tests.pri ) { - error( "Couldn't find the examples.pri file!" ) +!include( ../../tests.pri ) { + error( "Couldn't find the test.pri file!" ) } + QT+=opengl TARGET = wavechart SOURCES += main.cpp wavechart.cpp diff --git a/tests/tests.pro b/tests/tests.pro index e6aa356..ce8428e 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,19 +1,3 @@ TEMPLATE = subdirs -SUBDIRS += \ - auto \ - presenterchart \ - polarcharttest \ - boxplottester - -contains(QT_CONFIG, opengl) { - SUBDIRS += chartwidgettest \ - wavechart \ - chartviewer -} else { - message("OpenGL not available. Some test apps are disabled") -} - -qtHaveModule(quick) { - SUBDIRS += qmlchartproperties \ - qmlchartaxis -} +SUBDIRS += auto +exists(manual): SUBDIRS += manual