From f8e4bff0a6dfaf51d812a78a8c479e340359a02b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 12 May 2025 09:25:47 +0200 Subject: [PATCH] qBound: Don't claim it's "equivalent to qMax(min, qMin(val, max))" While technically true, those don't assert while qBound does, so it gives you a false sense of security that qBound(min, val, max) is safe for unsanitized input ranges. Pick-to: 6.8 6.5 Change-Id: Ie26f5eba586a3cd2d3e0cd769427f518e1bc92b9 Reviewed-by: Fabian Kosmale Reviewed-by: Giuseppe D'Angelo (cherry picked from commit 427bd9a42c68f6cc7afd9b9c13036873916cbfa0) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qminmax.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/global/qminmax.qdoc b/src/corelib/global/qminmax.qdoc index 36f680b4c7b..85de73416c9 100644 --- a/src/corelib/global/qminmax.qdoc +++ b/src/corelib/global/qminmax.qdoc @@ -28,8 +28,7 @@ /*! \fn template const T &qBound(const T &min, const T &val, const T &max) \relates - Returns \a val bounded by \a min and \a max. This is equivalent - to qMax(\a min, qMin(\a val, \a max)). + Returns \a val bounded by \a min and \a max. Example: