diff options
Diffstat (limited to 'examples/charts/stackedbarchartdrilldown/main.cpp')
-rw-r--r-- | examples/charts/stackedbarchartdrilldown/main.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/examples/charts/stackedbarchartdrilldown/main.cpp b/examples/charts/stackedbarchartdrilldown/main.cpp index 63043dfe..c2138f36 100644 --- a/examples/charts/stackedbarchartdrilldown/main.cpp +++ b/examples/charts/stackedbarchartdrilldown/main.cpp @@ -49,12 +49,15 @@ int main(int argc, char *argv[]) //! [2] // Define categories - QStringList months; - months << "May" << "Jun" << "Jul" << "Aug" << "Sep"; - QStringList weeks; - weeks << "week 1" << "week 2" << "week 3" << "week 4"; - QStringList plants; - plants << "Habanero" << "Lemon Drop" << "Starfish" << "Aji Amarillo"; + const QStringList months = { + "May", "Jun", "Jul", "Aug", "Sep" + }; + const QStringList weeks = { + "week 1", "week 2", "week 3", "week 4" + }; + const QStringList plants = { + "Habanero", "Lemon Drop", "Starfish", "Aji Amarillo" + }; //! [2] //! [3] @@ -87,7 +90,7 @@ int main(int argc, char *argv[]) //! [4] // Fill monthly and weekly series with data - foreach (QString plant, plants) { + for (const QString &plant : plants) { QBarSet *monthlyCrop = new QBarSet(plant); for (int month = 0; month < months.count(); month++) { QBarSet *weeklyCrop = new QBarSet(plant); |