diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-17 16:30:47 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-21 14:52:43 +0200 |
commit | 080bbb9f8b8af9b31ceabffc2ff04edb316efb02 (patch) | |
tree | 5044dcc6d94cb8ef82efc3ff5e23fd20d60c6bd3 | |
parent | 3635acd27a41e2e63646c09ece294cdb1a6cbf2f (diff) |
Improve version-related docs in qglobal.cpp
Give a more pragmatic illustration for QT_DEPRECATED_BEFORE.
Make various minor tweaks to wording, use slightly less antique
versions in examples. Make usage of "runtime" standard in qglobal.cpp,
at least, since "run-time" seems to be less used generally.
Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp | 4 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 44 |
2 files changed, 25 insertions, 23 deletions
diff --git a/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp b/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp index 82f916581e..7ec2203e5f 100644 --- a/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp +++ b/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -108,7 +108,7 @@ if (messageBox.clickedButton() == disconnectButton) { int main(int argc, char *argv[]) { - QT_REQUIRE_VERSION(argc, argv, "4.0.2") + QT_REQUIRE_VERSION(argc, argv, "6.1.2") QApplication app(argc, argv); ... diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 3efdd65baf..49d8bbeb85 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -768,7 +768,7 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); the value rounded up to the nearest integer and 64-bit integer respectively, the qInstallMessageHandler() function which installs the given QtMessageHandler, and the qVersion() function which - returns the version number of Qt at run-time as a string. + returns the version number of Qt at runtime as a string. \section1 Macros @@ -801,9 +801,9 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); The QT_POINTER_SIZE macro expands to the size of a pointer in bytes. - The macros QT_VERSION and QT_VERSION_STR expand to a numeric value - or a string, respectively, that specifies the version of Qt that the - application is compiled against. + The macros QT_VERSION and QT_VERSION_STR expand to a numeric value or a + string, respectively. These identify the version of Qt that the application + is compiled with. \sa <QtAlgorithms>, QSysInfo */ @@ -1349,9 +1349,10 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); \macro QT_VERSION_STR \relates <QtGlobal> - This macro expands to a string that specifies Qt's version number - (for example, "4.1.2"). This is the version against which the - application is compiled. + This macro expands to a string that specifies Qt's version number (for + example, "6.1.2"). This is the version with which the application is + compiled. This may be a different version than the version the application + will find itself using at \e runtime. \sa qVersion(), QT_VERSION */ @@ -1359,9 +1360,9 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); /*! \relates <QtGlobal> - Returns the version number of Qt at run-time as a string (for - example, "4.1.2"). This may be a different version than the - version the application was compiled against. + Returns the version number of Qt at runtime as a string (for example, + "6.1.2"). This may be a different version than the version the application + was \e compiled with. \sa QT_VERSION_STR, QLibraryInfo::version() */ @@ -2075,11 +2076,12 @@ bool qSharedBuild() noexcept a specified version of Qt or any earlier version. The default version number is 5.0, meaning that functions deprecated in or before Qt 5.0 will not be included. - For instance, when using a future release of Qt 5, set - \c{QT_DISABLE_DEPRECATED_BEFORE=0x050100} to disable functions deprecated in - Qt 5.1 and earlier. In any release, set - \c{QT_DISABLE_DEPRECATED_BEFORE=0x000000} to enable all functions, including - the ones deprecated in Qt 5.0. + For instance, when preparing to upgrade to Qt 6.3, setting + \c{QT_DISABLE_DEPRECATED_BEFORE=0x0602ff} will disable functions deprecated in + Qt 6.2 and earlier, making it easy to find changes worth making before the + upgrade. In any release, set \c{QT_DISABLE_DEPRECATED_BEFORE=0x000000} to + enable all functions, including the ones deprecated in Qt 5.0 (although most + of those have by now been removed entirely). \sa QT_DEPRECATED_WARNINGS */ @@ -4467,14 +4469,14 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) \relates <QtGlobal> This macro can be used to ensure that the application is run - against a recent enough version of Qt. This is especially useful + with a recent enough version of Qt. This is especially useful if your application depends on a specific bug fix introduced in a - bug-fix release (e.g., 4.0.2). + bug-fix release (for example, 6.1.2). The \a argc and \a argv parameters are the \c main() function's \c argc and \c argv parameters. The \a version parameter is a string literal that specifies which version of Qt the application - requires (e.g., "4.0.2"). + requires (for example, "6.1.2"). Example: @@ -4557,7 +4559,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) puts a single space between each item, and outputs a newline at the end. It supports many C++ and Qt types. - To suppress the output at run-time, install your own message handler + To suppress the output at runtime, install your own message handler with qInstallMessageHandler(). \sa qInfo(), qWarning(), qCritical(), qFatal(), qInstallMessageHandler(), @@ -4595,8 +4597,8 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) puts a single space between each item, and outputs a newline at the end. It supports many C++ and Qt types. - To suppress the output at run-time, install your own message handler - with qInstallMessageHandler(). + To suppress the output at runtime, install your own message handler + using qInstallMessageHandler(). \sa qDebug(), qWarning(), qCritical(), qFatal(), qInstallMessageHandler(), {Debugging Techniques} |