summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2017-01-22 00:08:16 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2017-01-23 23:05:56 +0000
commitcbd7dea83ed5d1f8876759e44d589b0e4c90c5f3 (patch)
treef2fbe28b3fd85ab38cc07d9d872fecc02457ddbd /src
parent00bbb4d27301a566f004880d68d3be8659620506 (diff)
Doc: updated QString::fromRawData documentation to QRegularExpression
QString::fromRawData code sample still shows the use of QRegExp. This patch updates it for QRegularExpression and cleans the code. Change-Id: Iff0f736cdbdd7d35c65fde1496ce9f838a8f5c6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/snippets/qstring/main.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp
index 5871026f95..41ee5a9cef 100644
--- a/src/corelib/doc/snippets/qstring/main.cpp
+++ b/src/corelib/doc/snippets/qstring/main.cpp
@@ -380,14 +380,14 @@ void Widget::fillFunction()
void Widget::fromRawDataFunction()
{
//! [22]
- QRegExp pattern;
+ QRegularExpression pattern("\u00A4");
static const QChar unicode[] = {
0x005A, 0x007F, 0x00A4, 0x0060,
0x1009, 0x0020, 0x0020};
int size = sizeof(unicode) / sizeof(QChar);
QString str = QString::fromRawData(unicode, size);
- if (str.contains(QRegExp(pattern))) {
+ if (str.contains(pattern) {
// ...
//! [22] //! [23]
}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 8888eced87..9a3c05ac85 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -8144,7 +8144,7 @@ bool QString::isRightToLeft() const
to create a deep copy of the data, ensuring that the raw data
isn't modified.
- Here's an example of how we can use a QRegExp on raw data in
+ Here's an example of how we can use a QRegularExpression on raw data in
memory without requiring to copy the data into a QString:
\snippet qstring/main.cpp 22