From 44028a227eb72ce65c971e5fabde1abdd2adfdb0 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 17 Sep 2021 15:04:03 +0200 Subject: Encourage use of QT_VERSION_CHECK() Document that QT_VERSION should normally be compared against it, rather than raw hex, and mildly update the example versions used in docs. (Left the snippets testing old version, since the code in which the #if-ery is used might actually make sense for those versions.) Improve related documentation in the process. Change-Id: Id3e97f41bfb0f81a117cf7b3a3ccd5f244e2a99a Reviewed-by: Thiago Macieira --- src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/doc/snippets/code') diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index ced30cf32a..55ce52a2e7 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -203,7 +203,7 @@ int boundedValue = qBound(minValue, myValue, maxValue); //! [16] -#if QT_VERSION >= 0x040100 +#if QT_VERSION >= QT_VERSION_CHECK(4, 1, 0) QIcon icon = style()->standardIcon(QStyle::SP_TrashIcon); #else QPixmap pixmap = style()->standardPixmap(QStyle::SP_TrashIcon); @@ -718,7 +718,7 @@ bool readConfiguration(const QFile &file) //! [qt-version-check] #include -#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include #else #include -- cgit v1.2.3