diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-05-17 16:29:19 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-19 05:41:41 +0000 |
commit | 24ef5d2263a11428cd9db83da1d8d9cb3534bc9f (patch) | |
tree | 516311b5c10080af49b83a3eede924dc16f00d00 /src/corelib/tools/qstring.cpp | |
parent | 302cc32deed6f230fa3987f94e962b0f0d43439a (diff) |
QStringRef: add truncate()
Missing part of QString API.
[ChangeLog][QtCore][QStringRef] Added truncate(int).
Change-Id: I49e218daf8f47fcd3dad131155e0abc8e2a133e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 2585686156..04d94b4a2b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -4880,7 +4880,7 @@ modifiable reference. If \a position is negative, it is equivalent to passing zero. - \sa chop(), resize(), left() + \sa chop(), resize(), left(), QStringRef::truncate() */ void QString::truncate(int pos) @@ -9376,6 +9376,20 @@ QStringRef QString::midRef(int position, int n) const } /*! + \fn void QStringRef::truncate(int position) + \since 5.6 + + Truncates the string at the given \a position index. + + If the specified \a position index is beyond the end of the + string, nothing happens. + + If \a position is negative, it is equivalent to passing zero. + + \sa QString::truncate() +*/ + +/*! \since 4.8 Returns the index position of the first occurrence of the string \a |