From f689de612f59d0b5b89c2d652f13c373e14a4ce1 2012-09-25 10:46:57 From: Jani Honkonen Date: 2012-09-25 10:46:57 Subject: [PATCH] more coding style fixes for examples and for one demo --- diff --git a/demos/chartviewer/window.cpp b/demos/chartviewer/window.cpp index a969c78..cb6739d 100644 --- a/demos/chartviewer/window.cpp +++ b/demos/chartviewer/window.cpp @@ -544,7 +544,7 @@ QMenu *Window::createMenu() menu->addMenu(subMenu); } - foreach(Chart *chart, subCategoryMap.values(subCategory)) { + foreach (Chart *chart, subCategoryMap.values(subCategory)) { createMenuAction(subMenu, QIcon(), chart->name(), qVariantFromValue((void *) chart)); } diff --git a/examples/areachart/main.cpp b/examples/areachart/main.cpp index 6ee7f0a..33fd624 100644 --- a/examples/areachart/main.cpp +++ b/examples/areachart/main.cpp @@ -31,8 +31,8 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![1] - QLineSeries* series0 = new QLineSeries(); - QLineSeries* series1 = new QLineSeries(); + QLineSeries *series0 = new QLineSeries(); + QLineSeries *series1 = new QLineSeries(); //![1] //![2] @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QAreaSeries* series = new QAreaSeries(series0, series1); + QAreaSeries *series = new QAreaSeries(series0, series1); series->setName("Batman"); QPen pen(0x059605); pen.setWidth(3); @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) //![3] //![4] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple areachart example"); chart->createDefaultAxes(); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) //![4] //![5] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![5] diff --git a/examples/barchart/main.cpp b/examples/barchart/main.cpp index fceda14..8a3728f 100644 --- a/examples/barchart/main.cpp +++ b/examples/barchart/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) //![1] //![2] - QBarSeries* series = new QBarSeries(); + QBarSeries *series = new QBarSeries(); series->append(set0); series->append(set1); series->append(set2); @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple barchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisX(axis, series); @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/barmodelmapper/customtablemodel.cpp b/examples/barmodelmapper/customtablemodel.cpp index 70f28c4..82e976f 100644 --- a/examples/barmodelmapper/customtablemodel.cpp +++ b/examples/barmodelmapper/customtablemodel.cpp @@ -45,13 +45,13 @@ CustomTableModel::CustomTableModel(QObject *parent) : } } -int CustomTableModel::rowCount(const QModelIndex & parent) const +int CustomTableModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent) return m_data.count(); } -int CustomTableModel::columnCount(const QModelIndex & parent) const +int CustomTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent) return m_columnCount; @@ -68,7 +68,7 @@ QVariant CustomTableModel::headerData(int section, Qt::Orientation orientation, return QString("%1").arg(section + 1); } -QVariant CustomTableModel::data(const QModelIndex & index, int role) const +QVariant CustomTableModel::data(const QModelIndex &index, int role) const { if (role == Qt::DisplayRole) { return m_data[index.row()]->at(index.column()); @@ -86,7 +86,7 @@ QVariant CustomTableModel::data(const QModelIndex & index, int role) const return QVariant(); } -bool CustomTableModel::setData(const QModelIndex & index, const QVariant & value, int role) +bool CustomTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (index.isValid() && role == Qt::EditRole) { m_data[index.row()]->replace(index.column(), value.toDouble()); @@ -96,7 +96,7 @@ bool CustomTableModel::setData(const QModelIndex & index, const QVariant & value return false; } -Qt::ItemFlags CustomTableModel::flags(const QModelIndex & index) const +Qt::ItemFlags CustomTableModel::flags(const QModelIndex &index) const { return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; } diff --git a/examples/barmodelmapper/customtablemodel.h b/examples/barmodelmapper/customtablemodel.h index d01ab8b..7b7e63f 100644 --- a/examples/barmodelmapper/customtablemodel.h +++ b/examples/barmodelmapper/customtablemodel.h @@ -31,12 +31,12 @@ class CustomTableModel : public QAbstractTableModel public: explicit CustomTableModel(QObject *parent = 0); - int rowCount(const QModelIndex & parent = QModelIndex()) const; - int columnCount(const QModelIndex & parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); - Qt::ItemFlags flags(const QModelIndex & index) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex &index) const; void addMapping(QString color, QRect area); void clearMapping() { m_mapping.clear(); } diff --git a/examples/barmodelmapper/tablewidget.cpp b/examples/barmodelmapper/tablewidget.cpp index 10f29bc..3bedf71 100644 --- a/examples/barmodelmapper/tablewidget.cpp +++ b/examples/barmodelmapper/tablewidget.cpp @@ -78,7 +78,7 @@ TableWidget::TableWidget(QWidget *parent) QString seriesColorHex = "#000000"; // get the color of the series and use it for showing the mapped area - QList barsets = series->barSets(); + QList barsets = series->barSets(); for (int i = 0; i < barsets.count(); i++) { seriesColorHex = "#" + QString::number(barsets.at(i)->brush().color().rgb(), 16).right(6).toUpper(); model->addMapping(seriesColorHex, QRect(1 + i, first, 1, barsets.at(i)->count())); @@ -88,7 +88,7 @@ TableWidget::TableWidget(QWidget *parent) //! [6] QStringList categories; categories << "April" << "May" << "June" << "July" << "August"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisX(axis, series); @@ -102,7 +102,7 @@ TableWidget::TableWidget(QWidget *parent) //! [8] // create main layout - QGridLayout* mainLayout = new QGridLayout; + QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(tableView, 1, 0); mainLayout->addWidget(chartView, 1, 1); mainLayout->setColumnStretch(1, 1); diff --git a/examples/customchart/main.cpp b/examples/customchart/main.cpp index 032acf7..5aae194 100644 --- a/examples/customchart/main.cpp +++ b/examples/customchart/main.cpp @@ -31,9 +31,9 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![1] - QLineSeries* series = new QLineSeries(); + QLineSeries *series = new QLineSeries(); *series << QPointF(0, 6) << QPointF(9, 4) << QPointF(15, 20) << QPointF(25, 12) << QPointF(29, 26); - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->legend()->hide(); chart->addSeries(series); //![1] @@ -62,8 +62,8 @@ int main(int argc, char *argv[]) //![2] //![3] - QCategoryAxis* axisX = new QCategoryAxis(); - QCategoryAxis* axisY = new QCategoryAxis(); + QCategoryAxis *axisX = new QCategoryAxis(); + QCategoryAxis *axisY = new QCategoryAxis(); // Customize axis label font QFont labelsFont; @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) //![4] //![5] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![5] diff --git a/examples/datetimeaxis/main.cpp b/examples/datetimeaxis/main.cpp index 2ae9305..13003c1 100644 --- a/examples/datetimeaxis/main.cpp +++ b/examples/datetimeaxis/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); //![1] - QLineSeries* series = new QLineSeries(); + QLineSeries *series = new QLineSeries(); //![1] //![2] @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->legend()->hide(); chart->createDefaultAxes(); @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) //![4] //![5] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![5] diff --git a/examples/donutbreakdown/main.cpp b/examples/donutbreakdown/main.cpp index 3c7bfde..a34794e 100644 --- a/examples/donutbreakdown/main.cpp +++ b/examples/donutbreakdown/main.cpp @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) //![3] QMainWindow window; - QChartView* chartView = new QChartView(donutBreakdown); + QChartView *chartView = new QChartView(donutBreakdown); chartView->setRenderHint(QPainter::Antialiasing); window.setCentralWidget(chartView); window.resize(800, 600); diff --git a/examples/donutchart/main.cpp b/examples/donutchart/main.cpp index 789b9b7..6044531 100644 --- a/examples/donutchart/main.cpp +++ b/examples/donutchart/main.cpp @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) //![1] //![2] - QChartView* chartView = new QChartView(); + QChartView *chartView = new QChartView(); chartView->setRenderHint(QPainter::Antialiasing); chartView->chart()->setTitle("Donut with a lemon glaze (100g)"); chartView->chart()->addSeries(series); diff --git a/examples/horizontalbarchart/main.cpp b/examples/horizontalbarchart/main.cpp index 1b1b0a4..57616d5 100644 --- a/examples/horizontalbarchart/main.cpp +++ b/examples/horizontalbarchart/main.cpp @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple horizontal barchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisY(axis, series); @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/horizontalpercentbarchart/main.cpp b/examples/horizontalpercentbarchart/main.cpp index 327d6f8..96e993b 100644 --- a/examples/horizontalpercentbarchart/main.cpp +++ b/examples/horizontalpercentbarchart/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple horizontal percent barchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisY(axis, series); @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/horizontalstackedbarchart/main.cpp b/examples/horizontalstackedbarchart/main.cpp index ec15368..bea6492 100644 --- a/examples/horizontalstackedbarchart/main.cpp +++ b/examples/horizontalstackedbarchart/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple horizontal stacked barchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisY(axis, series); @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/legend/mainwidget.cpp b/examples/legend/mainwidget.cpp index fe2b2fd..6a05917 100644 --- a/examples/legend/mainwidget.cpp +++ b/examples/legend/mainwidget.cpp @@ -69,7 +69,7 @@ MainWidget::MainWidget(QWidget *parent) : connect(m_legendWidth, SIGNAL(valueChanged(double)), this, SLOT(updateLegendLayout())); connect(m_legendHeight, SIGNAL(valueChanged(double)), this, SLOT(updateLegendLayout())); - QFormLayout* legendLayout = new QFormLayout(); + QFormLayout *legendLayout = new QFormLayout(); legendLayout->addRow("HPos", m_legendPosX); legendLayout->addRow("VPos", m_legendPosY); legendLayout->addRow("Width", m_legendWidth); @@ -88,7 +88,7 @@ MainWidget::MainWidget(QWidget *parent) : m_fontSize->setValue(m_chart->legend()->font().pointSizeF()); connect(m_fontSize, SIGNAL(valueChanged(double)), this, SLOT(fontSizeChanged())); - QFormLayout* fontLayout = new QFormLayout(); + QFormLayout *fontLayout = new QFormLayout(); fontLayout->addRow("Legend font size", m_fontSize); // Create layout for grid and detached legend @@ -180,7 +180,7 @@ void MainWidget::addBarset() void MainWidget::removeBarset() { - QList sets = m_series->barSets(); + QList sets = m_series->barSets(); if (sets.count() > 0) { m_series->remove(sets.at(sets.count() - 1)); } diff --git a/examples/legend/mainwidget.h b/examples/legend/mainwidget.h index f17c278..72c7540 100644 --- a/examples/legend/mainwidget.h +++ b/examples/legend/mainwidget.h @@ -68,7 +68,7 @@ private: QDoubleSpinBox *m_fontSize; // For detached layout - QGroupBox* m_legendSettings; + QGroupBox *m_legendSettings; QDoubleSpinBox *m_legendPosX; QDoubleSpinBox *m_legendPosY; QDoubleSpinBox *m_legendWidth; diff --git a/examples/lineandbar/main.cpp b/examples/lineandbar/main.cpp index cc72c4f..9124962 100644 --- a/examples/lineandbar/main.cpp +++ b/examples/lineandbar/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) //![1] //![2] - QBarSeries* barseries = new QBarSeries(); + QBarSeries *barseries = new QBarSeries(); barseries->append(set0); barseries->append(set1); barseries->append(set2); @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) //![2] //![8] - QLineSeries* lineseries = new QLineSeries(); + QLineSeries *lineseries = new QLineSeries(); lineseries->append(QPoint(0, 4)); lineseries->append(QPoint(1, 15)); @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) //![8] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(barseries); chart->addSeries(lineseries); chart->setTitle("Line and barchart example"); @@ -78,13 +78,13 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axisX = new QBarCategoryAxis(); + QBarCategoryAxis *axisX = new QBarCategoryAxis(); axisX->append(categories); chart->setAxisX(axisX, lineseries); chart->setAxisX(axisX, barseries); axisX->setRange(QString("Jan"), QString("Jun")); - QValueAxis* axisY = new QValueAxis(); + QValueAxis *axisY = new QValueAxis(); chart->setAxisY(axisY, lineseries); chart->setAxisY(axisY, barseries); axisY->setRange(0, 20); @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/linechart/main.cpp b/examples/linechart/main.cpp index df09d6a..4acd0b7 100644 --- a/examples/linechart/main.cpp +++ b/examples/linechart/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![1] - QLineSeries* series = new QLineSeries(); + QLineSeries *series = new QLineSeries(); //![1] //![2] @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->legend()->hide(); chart->addSeries(series); chart->createDefaultAxes(); @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) //![3] //![4] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![4] diff --git a/examples/modeldata/customtablemodel.cpp b/examples/modeldata/customtablemodel.cpp index 50895e4..30d7bfc 100644 --- a/examples/modeldata/customtablemodel.cpp +++ b/examples/modeldata/customtablemodel.cpp @@ -45,13 +45,13 @@ CustomTableModel::CustomTableModel(QObject *parent) : } } -int CustomTableModel::rowCount(const QModelIndex & parent) const +int CustomTableModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent) return m_data.count(); } -int CustomTableModel::columnCount(const QModelIndex & parent) const +int CustomTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent) return m_columnCount; @@ -72,7 +72,7 @@ QVariant CustomTableModel::headerData(int section, Qt::Orientation orientation, } } -QVariant CustomTableModel::data(const QModelIndex & index, int role) const +QVariant CustomTableModel::data(const QModelIndex &index, int role) const { if (role == Qt::DisplayRole) { return m_data[index.row()]->at(index.column()); @@ -89,7 +89,7 @@ QVariant CustomTableModel::data(const QModelIndex & index, int role) const return QVariant(); } -bool CustomTableModel::setData(const QModelIndex & index, const QVariant & value, int role) +bool CustomTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (index.isValid() && role == Qt::EditRole) { m_data[index.row()]->replace(index.column(), value.toDouble()); @@ -99,7 +99,7 @@ bool CustomTableModel::setData(const QModelIndex & index, const QVariant & value return false; } -Qt::ItemFlags CustomTableModel::flags(const QModelIndex & index) const +Qt::ItemFlags CustomTableModel::flags(const QModelIndex &index) const { return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; } diff --git a/examples/modeldata/customtablemodel.h b/examples/modeldata/customtablemodel.h index d01ab8b..7b7e63f 100644 --- a/examples/modeldata/customtablemodel.h +++ b/examples/modeldata/customtablemodel.h @@ -31,12 +31,12 @@ class CustomTableModel : public QAbstractTableModel public: explicit CustomTableModel(QObject *parent = 0); - int rowCount(const QModelIndex & parent = QModelIndex()) const; - int columnCount(const QModelIndex & parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); - Qt::ItemFlags flags(const QModelIndex & index) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex &index) const; void addMapping(QString color, QRect area); void clearMapping() { m_mapping.clear(); } diff --git a/examples/modeldata/tablewidget.cpp b/examples/modeldata/tablewidget.cpp index 8c309c1..d7857bc 100644 --- a/examples/modeldata/tablewidget.cpp +++ b/examples/modeldata/tablewidget.cpp @@ -102,7 +102,7 @@ TableWidget::TableWidget(QWidget *parent) //! [9] // create main layout - QGridLayout* mainLayout = new QGridLayout; + QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(tableView, 1, 0); mainLayout->addWidget(chartView, 1, 1); mainLayout->setColumnStretch(1, 1); diff --git a/examples/multiaxis/main.cpp b/examples/multiaxis/main.cpp index 322dd9f..f25fb91 100644 --- a/examples/multiaxis/main.cpp +++ b/examples/multiaxis/main.cpp @@ -35,10 +35,10 @@ int main(int argc, char *argv[]) qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); //![1] - QLineSeries* series; + QLineSeries *series; QValueAxis *axisX; QValueAxis *axisY; - QChart* chart = new QChart(); + QChart *chart = new QChart(); for (int i = 0; i < 5; i++) { series = new QLineSeries; for (int k(0); k < 8; k++) @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) //![3] //![4] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![4] diff --git a/examples/percentbarchart/main.cpp b/examples/percentbarchart/main.cpp index eee6d14..f216113 100644 --- a/examples/percentbarchart/main.cpp +++ b/examples/percentbarchart/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) //![1] //![2] - QPercentBarSeries* series = new QPercentBarSeries(); + QPercentBarSeries *series = new QPercentBarSeries(); series->append(set0); series->append(set1); series->append(set2); @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple percentbarchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisX(axis, series); @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/piechart/main.cpp b/examples/piechart/main.cpp index 7428361..9487f87 100644 --- a/examples/piechart/main.cpp +++ b/examples/piechart/main.cpp @@ -48,14 +48,14 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple piechart example"); chart->legend()->hide(); //![3] //![4] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![4] diff --git a/examples/piechartdrilldown/drilldownchart.cpp b/examples/piechartdrilldown/drilldownchart.cpp index 334732f..301691b 100644 --- a/examples/piechartdrilldown/drilldownchart.cpp +++ b/examples/piechartdrilldown/drilldownchart.cpp @@ -34,7 +34,7 @@ DrilldownChart::~DrilldownChart() } -void DrilldownChart::changeSeries(QAbstractSeries* series) +void DrilldownChart::changeSeries(QAbstractSeries *series) { // NOTE: if the series is owned by the chart it will be deleted // here the "window" owns the series... @@ -45,9 +45,9 @@ void DrilldownChart::changeSeries(QAbstractSeries* series) setTitle(series->name()); } -void DrilldownChart::handleSliceClicked(QPieSlice* slice) +void DrilldownChart::handleSliceClicked(QPieSlice *slice) { - DrilldownSlice* drilldownSlice = static_cast(slice); + DrilldownSlice *drilldownSlice = static_cast(slice); changeSeries(drilldownSlice->drilldownSeries()); } diff --git a/examples/piechartdrilldown/drilldownchart.h b/examples/piechartdrilldown/drilldownchart.h index 5cadc3e..80ff594 100644 --- a/examples/piechartdrilldown/drilldownchart.h +++ b/examples/piechartdrilldown/drilldownchart.h @@ -35,13 +35,13 @@ class DrilldownChart : public QChart public: explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~DrilldownChart(); - void changeSeries(QAbstractSeries* series); + void changeSeries(QAbstractSeries *series); public Q_SLOTS: - void handleSliceClicked(QPieSlice* slice); + void handleSliceClicked(QPieSlice *slice); private: - QAbstractSeries* m_currentSeries; + QAbstractSeries *m_currentSeries; }; #endif // DRILLDOWNCHART_H diff --git a/examples/piechartdrilldown/drilldownslice.cpp b/examples/piechartdrilldown/drilldownslice.cpp index ba5c0f8..bbc1489 100644 --- a/examples/piechartdrilldown/drilldownslice.cpp +++ b/examples/piechartdrilldown/drilldownslice.cpp @@ -22,7 +22,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE -DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries) +DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QAbstractSeries *drilldownSeries) : m_drilldownSeries(drilldownSeries), m_prefix(prefix) { @@ -38,7 +38,7 @@ DrilldownSlice::~DrilldownSlice() } -QAbstractSeries* DrilldownSlice::drilldownSeries() const +QAbstractSeries *DrilldownSlice::drilldownSeries() const { return m_drilldownSeries; } diff --git a/examples/piechartdrilldown/drilldownslice.h b/examples/piechartdrilldown/drilldownslice.h index 584ba1a..b9f12c4 100644 --- a/examples/piechartdrilldown/drilldownslice.h +++ b/examples/piechartdrilldown/drilldownslice.h @@ -33,16 +33,16 @@ class DrilldownSlice : public QPieSlice Q_OBJECT public: - DrilldownSlice(qreal value, QString prefix, QAbstractSeries* drilldownSeries); + DrilldownSlice(qreal value, QString prefix, QAbstractSeries *drilldownSeries); virtual ~DrilldownSlice(); - QAbstractSeries* drilldownSeries() const; + QAbstractSeries *drilldownSeries() const; public Q_SLOTS: void updateLabel(); void showHighlight(bool show); private: - QAbstractSeries* m_drilldownSeries; + QAbstractSeries *m_drilldownSeries; QString m_prefix; }; diff --git a/examples/piechartdrilldown/main.cpp b/examples/piechartdrilldown/main.cpp index 0ecc4c7..ee47ca9 100644 --- a/examples/piechartdrilldown/main.cpp +++ b/examples/piechartdrilldown/main.cpp @@ -37,13 +37,13 @@ int main(int argc, char *argv[]) QMainWindow window; - DrilldownChart* chart = new DrilldownChart(); + DrilldownChart *chart = new DrilldownChart(); chart->setTheme(QChart::ChartThemeLight); chart->setAnimationOptions(QChart::AllAnimations); chart->legend()->setVisible(true); chart->legend()->setAlignment(Qt::AlignRight); - QPieSeries* yearSeries = new QPieSeries(&window); + QPieSeries *yearSeries = new QPieSeries(&window); yearSeries->setName("Sales by year - All"); QList months; @@ -52,22 +52,22 @@ int main(int argc, char *argv[]) names << "Jane" << "John" << "Axel" << "Mary" << "Susan" << "Bob"; foreach (QString name, names) { - QPieSeries* series = new QPieSeries(&window); + QPieSeries *series = new QPieSeries(&window); series->setName("Sales by month - " + name); foreach (QString month, months) - *series << new DrilldownSlice(qrand() % 1000, month, yearSeries); + *series << new DrilldownSlice(qrand() % 1000, month, yearSeries); - QObject::connect(series, SIGNAL(clicked(QPieSlice*)), chart, SLOT(handleSliceClicked(QPieSlice*))); + QObject::connect(series, SIGNAL(clicked(QPieSlice *)), chart, SLOT(handleSliceClicked(QPieSlice *))); *yearSeries << new DrilldownSlice(series->sum(), name, series); } - QObject::connect(yearSeries, SIGNAL(clicked(QPieSlice*)), chart, SLOT(handleSliceClicked(QPieSlice*))); + QObject::connect(yearSeries, SIGNAL(clicked(QPieSlice *)), chart, SLOT(handleSliceClicked(QPieSlice *))); chart->changeSeries(yearSeries); - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); window.setCentralWidget(chartView); window.resize(800, 500); diff --git a/examples/presenterchart/chartview.cpp b/examples/presenterchart/chartview.cpp index 34c7736..f81dce6 100644 --- a/examples/presenterchart/chartview.cpp +++ b/examples/presenterchart/chartview.cpp @@ -25,7 +25,7 @@ #include #include -ChartView::ChartView(QChart* chart, QWidget* parent) +ChartView::ChartView(QChart *chart, QWidget *parent) : QChartView(chart, parent), m_index(-1), m_chart(chart) @@ -36,16 +36,16 @@ ChartView::ChartView(QChart* chart, QWidget* parent) m_timer.setInterval(3000); //![1] - QLineSeries* series0 = new QLineSeries(); + QLineSeries *series0 = new QLineSeries(); series0->setName("line"); - QScatterSeries* series1 = new QScatterSeries(); + QScatterSeries *series1 = new QScatterSeries(); series1->setName("scatter"); - QSplineSeries* series2 = new QSplineSeries(); + QSplineSeries *series2 = new QSplineSeries(); series2->setName("spline"); - QAreaSeries* series3 = new QAreaSeries(series0); + QAreaSeries *series3 = new QAreaSeries(series0); series3->setName("area"); //![1] diff --git a/examples/presenterchart/chartview.h b/examples/presenterchart/chartview.h index 03f55d7..1e4de3b 100644 --- a/examples/presenterchart/chartview.h +++ b/examples/presenterchart/chartview.h @@ -31,7 +31,7 @@ class ChartView: public QChartView { Q_OBJECT public: - ChartView(QChart* chart, QWidget* parent = 0); + ChartView(QChart *chart, QWidget *parent = 0); virtual ~ChartView(); public slots: diff --git a/examples/presenterchart/main.cpp b/examples/presenterchart/main.cpp index 35c8756..506acac 100644 --- a/examples/presenterchart/main.cpp +++ b/examples/presenterchart/main.cpp @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); QMainWindow window; - QChart* chart = new QChart(); + QChart *chart = new QChart(); ChartView chartView(chart, &window); chartView.setRenderHint(QPainter::Antialiasing); chart->setAnimationOptions(QChart::SeriesAnimations); diff --git a/examples/scatterchart/main.cpp b/examples/scatterchart/main.cpp index e427442..94e5fc7 100644 --- a/examples/scatterchart/main.cpp +++ b/examples/scatterchart/main.cpp @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![4] - ChartView* chartView = new ChartView(); + ChartView *chartView = new ChartView(); QMainWindow window; window.setCentralWidget(chartView); window.resize(400, 300); diff --git a/examples/scatterinteractions/chartview.cpp b/examples/scatterinteractions/chartview.cpp index bc6db9b..8545a98 100644 --- a/examples/scatterinteractions/chartview.cpp +++ b/examples/scatterinteractions/chartview.cpp @@ -56,7 +56,7 @@ ChartView::~ChartView() { } -void ChartView::handleClickedPoint(const QPointF& point) +void ChartView::handleClickedPoint(const QPointF &point) { QPointF clickedPoint = point; // Find the closest point from series 1 diff --git a/examples/scatterinteractions/chartview.h b/examples/scatterinteractions/chartview.h index 80f393c..65daa8c 100644 --- a/examples/scatterinteractions/chartview.h +++ b/examples/scatterinteractions/chartview.h @@ -36,7 +36,7 @@ public: ~ChartView(); private Q_SLOTS: - void handleClickedPoint(const QPointF& point); + void handleClickedPoint(const QPointF &point); private: QScatterSeries *m_scatter; diff --git a/examples/scrollchart/chart.cpp b/examples/scrollchart/chart.cpp index e8d9150..cef33d7 100644 --- a/examples/scrollchart/chart.cpp +++ b/examples/scrollchart/chart.cpp @@ -41,11 +41,11 @@ Chart::~Chart() bool Chart::sceneEvent(QEvent *event) { if (event->type() == QEvent::Gesture) - return gestureEvent(static_cast(event)); + return gestureEvent(static_cast(event)); return QChart::event(event); } -bool Chart::gestureEvent(QGestureEvent* event) +bool Chart::gestureEvent(QGestureEvent *event) { if (QGesture *gesture = event->gesture(Qt::PanGesture)) { QPanGesture *pan = static_cast(gesture); diff --git a/examples/scrollchart/chart.h b/examples/scrollchart/chart.h index a8cf6cb..0a6e702 100644 --- a/examples/scrollchart/chart.h +++ b/examples/scrollchart/chart.h @@ -39,10 +39,7 @@ protected: bool sceneEvent(QEvent *event); private: - bool gestureEvent(QGestureEvent* event); - -private: - + bool gestureEvent(QGestureEvent *event); }; #endif // CHART_H diff --git a/examples/scrollchart/main.cpp b/examples/scrollchart/main.cpp index c0fbd21..693c28a 100644 --- a/examples/scrollchart/main.cpp +++ b/examples/scrollchart/main.cpp @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); - QLineSeries* series = new QLineSeries(); + QLineSeries *series = new QLineSeries(); for (int i = 0; i < 500; i++) { QPointF p((qreal) i, qSin(M_PI / 50 * i) * 100); p.ry() += qrand() % 20; @@ -55,14 +55,14 @@ int main(int argc, char *argv[]) *set4 << 9 << 7 << 5 << 3 << 1 << 2; //QHorizontalBarSeries* series2 = new QHorizontalBarSeries(); - QBarSeries* series2 = new QBarSeries(); + QBarSeries *series2 = new QBarSeries(); series2->append(set0); series2->append(set1); series2->append(set2); series2->append(set3); series2->append(set4); - Chart* chart = new Chart(); + Chart *chart = new Chart(); // chart->addSeries(series); chart->addSeries(series2); chart->setTitle("Scroll in/out example"); @@ -71,11 +71,11 @@ int main(int argc, char *argv[]) QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->setAxisX(axis, series2); - ChartView* chartView = new ChartView(chart); + ChartView *chartView = new ChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); QMainWindow window; diff --git a/examples/splinechart/main.cpp b/examples/splinechart/main.cpp index 9b0dc2d..38962b0 100644 --- a/examples/splinechart/main.cpp +++ b/examples/splinechart/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![1] - QSplineSeries* series = new QSplineSeries(); + QSplineSeries *series = new QSplineSeries(); series->setName("spline"); //![1] @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->legend()->hide(); chart->addSeries(series); chart->setTitle("Simple spline chart example"); @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) //![3] //![4] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![4] diff --git a/examples/stackedbarchart/main.cpp b/examples/stackedbarchart/main.cpp index 34cc739..9f5b000 100644 --- a/examples/stackedbarchart/main.cpp +++ b/examples/stackedbarchart/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) //![1] //![2] - QStackedBarSeries* series = new QStackedBarSeries(); + QStackedBarSeries *series = new QStackedBarSeries(); series->append(set0); series->append(set1); series->append(set2); @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple stackedbarchart example"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) //![4] QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisX(axis, series); @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/stackedbarchartdrilldown/drilldownchart.cpp b/examples/stackedbarchartdrilldown/drilldownchart.cpp index e014214..71d7e66 100644 --- a/examples/stackedbarchartdrilldown/drilldownchart.cpp +++ b/examples/stackedbarchartdrilldown/drilldownchart.cpp @@ -38,7 +38,7 @@ void DrilldownChart::changeSeries(DrilldownBarSeries *series) m_currentSeries = series; // Reset axis - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(m_currentSeries->categories()); addSeries(series); @@ -52,7 +52,7 @@ void DrilldownChart::changeSeries(DrilldownBarSeries *series) void DrilldownChart::handleClicked(int index, QBarSet *barset) { Q_UNUSED(barset) - DrilldownBarSeries* series = static_cast(sender()); + DrilldownBarSeries *series = static_cast(sender()); changeSeries(series->drilldownSeries(index)); } diff --git a/examples/stackedbarchartdrilldown/drilldownchart.h b/examples/stackedbarchartdrilldown/drilldownchart.h index 1c2d573..12b990f 100644 --- a/examples/stackedbarchartdrilldown/drilldownchart.h +++ b/examples/stackedbarchartdrilldown/drilldownchart.h @@ -39,7 +39,7 @@ public Q_SLOTS: void handleClicked(int index, QBarSet *barset); private: - DrilldownBarSeries* m_currentSeries; + DrilldownBarSeries *m_currentSeries; }; //! [1] diff --git a/examples/stackedbarchartdrilldown/drilldownseries.cpp b/examples/stackedbarchartdrilldown/drilldownseries.cpp index 949a6f2..97eeee0 100644 --- a/examples/stackedbarchartdrilldown/drilldownseries.cpp +++ b/examples/stackedbarchartdrilldown/drilldownseries.cpp @@ -28,12 +28,12 @@ DrilldownBarSeries::DrilldownBarSeries(QStringList categories, QObject *parent) m_categories = categories; } -void DrilldownBarSeries::mapDrilldownSeries(int index, DrilldownBarSeries* drilldownSeries) +void DrilldownBarSeries::mapDrilldownSeries(int index, DrilldownBarSeries *drilldownSeries) { m_DrilldownSeries[index] = drilldownSeries; } -DrilldownBarSeries* DrilldownBarSeries::drilldownSeries(int index) +DrilldownBarSeries *DrilldownBarSeries::drilldownSeries(int index) { return m_DrilldownSeries[index]; } diff --git a/examples/stackedbarchartdrilldown/drilldownseries.h b/examples/stackedbarchartdrilldown/drilldownseries.h index e9eaa4d..e37b729 100644 --- a/examples/stackedbarchartdrilldown/drilldownseries.h +++ b/examples/stackedbarchartdrilldown/drilldownseries.h @@ -33,14 +33,14 @@ class DrilldownBarSeries : public QStackedBarSeries public: DrilldownBarSeries(QStringList categories, QObject *parent = 0); - void mapDrilldownSeries(int index, DrilldownBarSeries* drilldownSeries); + void mapDrilldownSeries(int index, DrilldownBarSeries *drilldownSeries); - DrilldownBarSeries* drilldownSeries(int index); + DrilldownBarSeries *drilldownSeries(int index); QStringList categories(); private: - QMap m_DrilldownSeries; + QMap m_DrilldownSeries; QStringList m_categories; }; //! [1] diff --git a/examples/stackedbarchartdrilldown/main.cpp b/examples/stackedbarchartdrilldown/main.cpp index 4aa440a..f7d6c49 100644 --- a/examples/stackedbarchartdrilldown/main.cpp +++ b/examples/stackedbarchartdrilldown/main.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) QMainWindow window; //! [1] - DrilldownChart* drilldownChart = new DrilldownChart(); + DrilldownChart *drilldownChart = new DrilldownChart(); drilldownChart->setTheme(QChart::ChartThemeBlueIcy); drilldownChart->setAnimationOptions(QChart::SeriesAnimations); //! [1] @@ -51,14 +51,14 @@ int main(int argc, char *argv[]) //! [3] // Create drilldown structure - DrilldownBarSeries* seasonSeries = new DrilldownBarSeries(months, drilldownChart); + DrilldownBarSeries *seasonSeries = new DrilldownBarSeries(months, drilldownChart); seasonSeries->setName("Crop by month - Season"); // Each month in season series has drilldown series for weekly data for (int month = 0; month < months.count(); month++) { // Create drilldown series for every week - DrilldownBarSeries* weeklySeries = new DrilldownBarSeries(weeks, drilldownChart); + DrilldownBarSeries *weeklySeries = new DrilldownBarSeries(weeks, drilldownChart); seasonSeries->mapDrilldownSeries(month, weeklySeries); // Drilling down from weekly data brings us back to season data. @@ -68,19 +68,19 @@ int main(int argc, char *argv[]) } // Use clicked signal to implement drilldown - QObject::connect(weeklySeries, SIGNAL(clicked(int, QBarSet*)), drilldownChart, SLOT(handleClicked(int, QBarSet*))); + QObject::connect(weeklySeries, SIGNAL(clicked(int, QBarSet *)), drilldownChart, SLOT(handleClicked(int, QBarSet *))); } // Enable drilldown from season series using clicked signal - QObject::connect(seasonSeries, SIGNAL(clicked(int, QBarSet*)), drilldownChart, SLOT(handleClicked(int, QBarSet*))); + QObject::connect(seasonSeries, SIGNAL(clicked(int, QBarSet *)), drilldownChart, SLOT(handleClicked(int, QBarSet *))); //! [3] //! [4] // Fill monthly and weekly series with data foreach (QString plant, plants) { - QBarSet* monthlyCrop = new QBarSet(plant); + QBarSet *monthlyCrop = new QBarSet(plant); for (int month = 0; month < months.count(); month++) { - QBarSet* weeklyCrop = new QBarSet(plant); + QBarSet *weeklyCrop = new QBarSet(plant); for (int week = 0; week < weeks.count(); week++) *weeklyCrop << (qrand() % 20); // Get the drilldown series from season series and add crop to it. diff --git a/examples/temperaturerecords/main.cpp b/examples/temperaturerecords/main.cpp index 241dcf8..60c645a 100644 --- a/examples/temperaturerecords/main.cpp +++ b/examples/temperaturerecords/main.cpp @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) //![2] //![3] - QChart* chart = new QChart(); + QChart *chart = new QChart(); chart->addSeries(series); chart->setTitle("Temperature records in celcius"); chart->setAnimationOptions(QChart::SeriesAnimations); @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) QStringList categories; categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec"; - QBarCategoryAxis* axis = new QBarCategoryAxis(); + QBarCategoryAxis *axis = new QBarCategoryAxis(); axis->append(categories); chart->createDefaultAxes(); chart->setAxisX(axis, series); @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) //![5] //![6] - QChartView* chartView = new QChartView(chart); + QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); //![6] diff --git a/examples/zoomlinechart/chart.cpp b/examples/zoomlinechart/chart.cpp index e8d9150..cef33d7 100644 --- a/examples/zoomlinechart/chart.cpp +++ b/examples/zoomlinechart/chart.cpp @@ -41,11 +41,11 @@ Chart::~Chart() bool Chart::sceneEvent(QEvent *event) { if (event->type() == QEvent::Gesture) - return gestureEvent(static_cast(event)); + return gestureEvent(static_cast(event)); return QChart::event(event); } -bool Chart::gestureEvent(QGestureEvent* event) +bool Chart::gestureEvent(QGestureEvent *event) { if (QGesture *gesture = event->gesture(Qt::PanGesture)) { QPanGesture *pan = static_cast(gesture); diff --git a/examples/zoomlinechart/chart.h b/examples/zoomlinechart/chart.h index a8cf6cb..84c7c19 100644 --- a/examples/zoomlinechart/chart.h +++ b/examples/zoomlinechart/chart.h @@ -39,7 +39,7 @@ protected: bool sceneEvent(QEvent *event); private: - bool gestureEvent(QGestureEvent* event); + bool gestureEvent(QGestureEvent *event); private: diff --git a/examples/zoomlinechart/main.cpp b/examples/zoomlinechart/main.cpp index f0fe44a..78b0d2c 100644 --- a/examples/zoomlinechart/main.cpp +++ b/examples/zoomlinechart/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); //![1] - QLineSeries* series = new QLineSeries(); + QLineSeries *series = new QLineSeries(); for (int i = 0; i < 500; i++) { QPointF p((qreal) i, qSin(M_PI / 50 * i) * 100); p.ry() += qrand() % 20; @@ -40,14 +40,14 @@ int main(int argc, char *argv[]) } //![1] - Chart* chart = new Chart(); + Chart *chart = new Chart(); chart->addSeries(series); chart->setTitle("Zoom in/out example"); chart->setAnimationOptions(QChart::SeriesAnimations); chart->legend()->hide(); chart->createDefaultAxes(); - ChartView* chartView = new ChartView(chart); + ChartView *chartView = new ChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); QMainWindow window;