From 6253493cdc1bf15fba87e27000185e1024ca04fe Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 16 Oct 2021 15:00:18 -0500 Subject: [PATCH] QmlWaveformOverview: fix float conversion warning with Qt6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [184/695] Building CXX object CMakeFiles/mixxx-lib.dir/src/qml/qmlwaveformoverview.cpp.o ../src/qml/qmlwaveformoverview.cpp: In member function ‘QColor mixxx::qml::QmlWaveformOverview::getRgbPenColor(ConstWaveformPointer, int) const’: ../src/qml/qmlwaveformoverview.cpp:258:27: warning: conversion from ‘qreal’ {aka ‘double’} to ‘float’ may change value [-Wfloat-conversion] 258 | color.setRgbF(red / max, green / max, blue / max); | ~~~~^~~~~ ../src/qml/qmlwaveformoverview.cpp:258:40: warning: conversion from ‘qreal’ {aka ‘double’} to ‘float’ may change value [-Wfloat-conversion] 258 | color.setRgbF(red / max, green / max, blue / max); | ~~~~~~^~~~~ ../src/qml/qmlwaveformoverview.cpp:258:52: warning: conversion from ‘qreal’ {aka ‘double’} to ‘float’ may change value [-Wfloat-conversion] 258 | color.setRgbF(red / max, green / max, blue / max); | ~~~~~^~~~~ --- src/qml/qmlwaveformoverview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qml/qmlwaveformoverview.cpp b/src/qml/qmlwaveformoverview.cpp index 6d9e151a647..fada7aff48e 100644 --- a/src/qml/qmlwaveformoverview.cpp +++ b/src/qml/qmlwaveformoverview.cpp @@ -255,7 +255,10 @@ QColor QmlWaveformOverview::getRgbPenColor(ConstWaveformPointer pWaveform, int c qreal max = math_max3(red, green, blue); if (max > 0.0) { QColor color; - color.setRgbF(red / max, green / max, blue / max); + color.setRgbF( + static_cast(red / max), + static_cast(green / max), + static_cast(blue / max)); return color; } return QColor();