diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-04-07 22:31:59 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-04-08 05:40:52 +0000 |
commit | de3785b8bc4eeec403835840b0328b5256854ea4 (patch) | |
tree | ba680f1110a03f9319137dbc0035556b4b711407 /src/corelib/tools/qversionnumber.h | |
parent | f5d8ad61a4c85a656a7332c43d0c42f5eaf43593 (diff) |
QVersionNumber: add fromString(QStringView/QLatin1String) overloads
The parsing code anyway operated on a QByteArray created from
toLatin1(), so expose this to the user by providing a QLatin1String
overload.
Also provide a QStringView overload, since we can. Port one user (in
qmake) to the new overload.
[ChangeLog][QtCore][QVersionNumber] Added QStringView and
QLatin1String overloads of fromString().
Change-Id: Idbff44c3997f5cfa86ea1bce8b3da4b700a3d9cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qversionnumber.h')
-rw-r--r-- | src/corelib/tools/qversionnumber.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 2aaa6201f7..a7f91e220c 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -280,7 +280,11 @@ public: Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2) Q_REQUIRED_RESULT; Q_CORE_EXPORT QString toString() const Q_REQUIRED_RESULT; +#if QT_STRINGVIEW_LEVEL < 2 Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR) Q_REQUIRED_RESULT; +#endif + Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr) Q_REQUIRED_RESULT; + Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr) Q_REQUIRED_RESULT; private: #ifndef QT_NO_DATASTREAM |