##// END OF EJS Templates
Scatter series marker visuals
Scatter series marker visuals

File last commit:

r165:2ff4f264aa68
r228:d02101a951c6
Show More
dataseriedialog.cpp
65 lines | 2.2 KiB | text/x-c | CppLexer
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 #include "dataseriedialog.h"
#include <QDialogButtonBox>
Tero Ahola
Test app now adds n data series of different type
r20 #include <QGridLayout>
#include <QComboBox>
#include <QPushButton>
#include <QLabel>
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 #include <QDebug>
Tero Ahola
The test app now preserves series type selection
r26 DataSerieDialog::DataSerieDialog(QString defaultType, QWidget *parent) :
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 QDialog(parent)
{
Tero Ahola
Test app now adds n data series of different type
r20 // Combo box for selecting the series type
m_seriesTypeCombo = new QComboBox(this);
m_seriesTypeCombo->addItem("Line");
m_seriesTypeCombo->addItem("Area");
m_seriesTypeCombo->addItem("Bar");
sauimone
bug fix in bar charts. Crashed, if layout was set before data. Also integrated to test app.
r165 m_seriesTypeCombo->addItem("StackedBar");
m_seriesTypeCombo->addItem("PercentBar");
Tero Ahola
Test app now adds n data series of different type
r20 m_seriesTypeCombo->addItem("Pie");
m_seriesTypeCombo->addItem("Scatter");
m_seriesTypeCombo->addItem("Spline");
Tero Ahola
The test app now preserves series type selection
r26 // Allow pre-selection of a series type
if (defaultType != "") {
int index = m_seriesTypeCombo->findText(defaultType);
if (index > 0)
m_seriesTypeCombo->setCurrentIndex(index);
}
Tero Ahola
Test app now adds n data series of different type
r20 // Combo box for selecting data for the new series
m_testDataCombo = new QComboBox(this);
m_testDataCombo->addItem("linear");
Tero Ahola
Fixed compilation of test/example apps
r27 m_testDataCombo->addItem("linear, 1M");
Tero Ahola
Test app now adds n data series of different type
r20 m_testDataCombo->addItem("SIN");
m_testDataCombo->addItem("SIN + random");
sauimone
bug fix in bar charts. Crashed, if layout was set before data. Also integrated to test app.
r165 m_testDataCombo->addItem("Table, 5 series");
Tero Ahola
Test app now adds n data series of different type
r20 m_testDataCombo->addItem("TODO From file...");
m_testDataCombo->addItem("TODO From URL...");
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();
grid->addWidget(new QLabel("Series type:"), 0, 0);
grid->addWidget(m_seriesTypeCombo, 0, 1);
grid->addWidget(new QLabel("Data:"), 1, 0);
grid->addWidget(m_testDataCombo, 1, 1);
grid->addWidget(addSeriesBox, 2, 1);
setLayout(grid);
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 }
Tero Ahola
Test app now adds n data series of different type
r20 void DataSerieDialog::accept()
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 {
Tero Ahola
Test app now adds n data series of different type
r20 accepted(m_seriesTypeCombo->currentText(), m_testDataCombo->currentText());
QDialog::accept();
Tero Ahola
Started to refactor the API to allow integrating different plot types
r19 }
Tero Ahola
Test app now adds n data series of different type
r20 //void DataSerieDialog::addSeries(QAbstractButton *button)
//{
// addSeries(button->text().toAscii());
// accept();
//}