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>
This commit is contained in:
Mitch Curtis 2013-02-26 17:13:44 +01:00 committed by The Qt Project
parent 4a6a066df2
commit a65982d659
2 changed files with 14 additions and 0 deletions

View File

@ -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]

View File

@ -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
*/