summaryrefslogtreecommitdiffstats
path: root/examples/charts/piechartdrilldown
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/piechartdrilldown')
-rw-r--r--examples/charts/piechartdrilldown/drilldownslice.cpp4
-rw-r--r--examples/charts/piechartdrilldown/main.cpp16
2 files changed, 11 insertions, 9 deletions
diff --git a/examples/charts/piechartdrilldown/drilldownslice.cpp b/examples/charts/piechartdrilldown/drilldownslice.cpp
index 5f83d006..1fc6bd81 100644
--- a/examples/charts/piechartdrilldown/drilldownslice.cpp
+++ b/examples/charts/piechartdrilldown/drilldownslice.cpp
@@ -38,8 +38,8 @@ DrilldownSlice::DrilldownSlice(qreal value, QString prefix, QAbstractSeries *dri
setValue(value);
updateLabel();
setLabelFont(QFont("Arial", 8));
- connect(this, SIGNAL(percentageChanged()), this, SLOT(updateLabel()));
- connect(this, SIGNAL(hovered(bool)), this, SLOT(showHighlight(bool)));
+ connect(this, &DrilldownSlice::percentageChanged, this, &DrilldownSlice::updateLabel);
+ connect(this, &DrilldownSlice::hovered, this, &DrilldownSlice::showHighlight);
}
DrilldownSlice::~DrilldownSlice()
diff --git a/examples/charts/piechartdrilldown/main.cpp b/examples/charts/piechartdrilldown/main.cpp
index 69f87158..3fd6ad65 100644
--- a/examples/charts/piechartdrilldown/main.cpp
+++ b/examples/charts/piechartdrilldown/main.cpp
@@ -55,24 +55,26 @@ int main(int argc, char *argv[])
QPieSeries *yearSeries = new QPieSeries(&window);
yearSeries->setName("Sales by year - All");
- QList<QString> months;
- months << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec";
- QList<QString> names;
- names << "Jane" << "John" << "Axel" << "Mary" << "Susan" << "Bob";
+ const QStringList months = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+ const QStringList names = {
+ "Jane", "John", "Axel", "Mary", "Susan", "Bob"
+ };
foreach (QString name, names) {
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, &QPieSeries::clicked, chart, &DrilldownChart::handleSliceClicked);
*yearSeries << new DrilldownSlice(series->sum(), name, series);
}
- QObject::connect(yearSeries, SIGNAL(clicked(QPieSlice*)), chart, SLOT(handleSliceClicked(QPieSlice*)));
+ QObject::connect(yearSeries, &QPieSeries::clicked, chart, &DrilldownChart::handleSliceClicked);
chart->changeSeries(yearSeries);