diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-28 03:00:26 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-28 03:00:26 +0200 |
commit | 8b4ad5a108b53e6964815856b37cf004099ce505 (patch) | |
tree | 095bcb952882ddd26868ce241aa21c2c21dcfc80 /tests | |
parent | 0e37ed7adebe68b65fe6b923617a543f1ebb30cc (diff) | |
parent | 1448df4988763d163b6753f9afddbec7999aedd8 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ib7c1f07ccaf6eac51303984b39c21d099ca0706a
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpieslice/tst_qpieslice.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/qpieslice/tst_qpieslice.cpp b/tests/auto/qpieslice/tst_qpieslice.cpp index 19d838f5..977ed35b 100644 --- a/tests/auto/qpieslice/tst_qpieslice.cpp +++ b/tests/auto/qpieslice/tst_qpieslice.cpp @@ -31,6 +31,8 @@ #include <tst_definitions.h> #include <QtCharts/QChartView> #include <QtCharts/QChart> +#include <QtCharts/QLegend> +#include <QtCharts/QLegendMarker> #include <QtCharts/QPieSlice> #include <QtCharts/QPieSeries> @@ -217,12 +219,20 @@ void tst_qpieslice::customize() QCOMPARE(s1->labelFont(), f1); // insert a slice - series->insert(0, new QPieSlice("slice 5", 5)); + series->insert(0, new QPieSlice("slice 0", 5)); QCOMPARE(s1->pen(), p1); QCOMPARE(s1->brush(), b1); QCOMPARE(s1->labelBrush(), b1); QCOMPARE(s1->labelFont(), f1); + // QTBUG-62082, verify correct insertion at 0. + const QStringList expectedLabels{"slice 0", "slice 1", "slice 3", "slice 4"}; + const auto legendMarkers = view.chart()->legend()->markers(); + const int legendMarkersSize = legendMarkers.size(); + QCOMPARE(legendMarkersSize, expectedLabels.size()); + for (int m = 0; m < legendMarkersSize; ++m) + QCOMPARE(legendMarkers.at(m)->label(), expectedLabels.at(m)); + // change theme // theme will overwrite customizations view.chart()->setTheme(QChart::ChartThemeHighContrast); |