diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-02-26 17:13:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-27 12:02:34 +0100 |
commit | a65982d659226ace42fe0a0ca0a2f15523e95e4b (patch) | |
tree | a73a181f7b81c33c66f568066a32cf41aa67085d /src | |
parent | 4a6a066df2f104763c35eaaaf8dc7b1366d483b2 (diff) |
Add snippet for QT_VERSION_CHECK.
Change-Id: I048771f21ce694329a7e9acd4dbfbebfec964b05
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 10 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 4 |
2 files changed, 14 insertions, 0 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 ddb84bcc74..7d7d71ac50 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -598,3 +598,13 @@ bool readConfiguration(const QFile &file) break; } //! [qunreachable-switch] + +//! [qt-version-check] +#include <QtGlobal> + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#include <QtWidgets> +#else +#include <QtGui> +#endif +//! [qt-version-check] diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 7fd9283579..f0fb9c1a02 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -846,6 +846,10 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can be compared with another similarly processed version id. + Example: + + \snippet code/src_corelib_global_qglobal.cpp qt-version-check + \sa QT_VERSION */ |