From 9c63b5bda1707453477e253d48bcf637e96919a7 2016-03-06 11:40:58 From: Marc Mutz Date: 2016-03-06 11:40:58 Subject: [PATCH] Fix compilation with GCC 6 qtcharts/tests/manual/chartwidgettest/mainwidget.cpp:211:74: error: call of overloaded ‘abs(double)’ is ambiguous newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); The file included , but used C's math.h abs(), which is integer-only. ^ Change-Id: Iaa7e19f282a460a8c2d79475a14c7372b9740d26 Reviewed-by: Lars Knoll --- diff --git a/tests/manual/chartwidgettest/mainwidget.cpp b/tests/manual/chartwidgettest/mainwidget.cpp index 61afdb2..9287a02 100644 --- a/tests/manual/chartwidgettest/mainwidget.cpp +++ b/tests/manual/chartwidgettest/mainwidget.cpp @@ -208,9 +208,9 @@ QList MainWidget::generateTestData(int columnCount, int rowCount, QStr QList newColumn; for (int i(0); i < rowCount; i++) { if (dataCharacteristics == "Sin") { - newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100)); + newColumn.append(std::abs(sin(3.14159265358979 / 50 * i) * 100)); } else if (dataCharacteristics == "Sin + random") { - newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); + newColumn.append(std::abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); } else if (dataCharacteristics == "Random") { newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); } else if (dataCharacteristics == "Linear") {