summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-09-17 15:04:03 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-09-20 15:05:36 +0200
commit44028a227eb72ce65c971e5fabde1abdd2adfdb0 (patch)
tree5ae1c5d15230d727059c3f1d959ef8bbebff52cc /src/corelib/doc/snippets/code
parent7943480f0f0cf130f4ca104d7e9235bbb2ba6ec2 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/doc/snippets/code')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp4
1 files changed, 2 insertions, 2 deletions
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 <QtGlobal>
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWidgets>
#else
#include <QtGui>