From 95e84c0ea95d3d3b7556c5c12bb2a52f856675d5 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 26 Feb 2020 12:50:31 +0100 Subject: Allow qMin, qMax and qBound for types that can be losslessly converted Add overloads for qMin and friends where the arguments are of different type, but one can be easily promoted to the other. Return the promoted type. Promotions are only allowed if both types are either signed, unsigned or floating point numbers. This should simplify writing code in many case (as for example qMin(myint64, 1)) and also help reduce source incompatibilities between Qt 5 and Qt 6, where the return types for sizes of our containers changes from int to qsizetype. Change-Id: Ia6bcf16bef0469ea568063e7c32f532da610d1cd Reviewed-by: Volker Hilsheimer Reviewed-by: Thiago Macieira --- .../corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/corelib/text/qstringbuilder/qstringbuilder4') diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp index 4efc69908e..2aecdcfff6 100644 --- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp +++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp @@ -26,6 +26,7 @@ ** ****************************************************************************/ +#include // SCENARIO 4 // this is the "full" version. Operator+ is replaced by a QStringBuilder -- cgit v1.2.3