You pretty much figured it out yourself. qMin returns a double, so Code: qMin(qMin(s.width() / 2, s.height() / 2), f) is seen by the compiler as Code: qMin(double, whatever_type_f_is) If f is float, convert it to double. The best solution would be to make it double to start with, but if that is not practical, simply cast it: Code: qMin(qMin(s.width() / 2, s.height() / 2), double(f)) C++ is funny like that. In C, the conversion from float to double is automatic. C++ thinks it's too cool for that. EDIT: In this case, C++ cannot convert automatically because qMin is a template and requires the same type for both parameters. The compiler does not know whether to convert them both to float or to double, so it gives up and throws a wobbly. I still think it should be smart enough to convert them both to the wider type, but as I say, C++ can be funny sometimes.
qMin(qMin(s.width() / 2, s.height() / 2), f)
qMin(double, whatever_type_f_is)
qMin(qMin(s.width() / 2, s.height() / 2), double(f))