diff options
Diffstat (limited to 'src/corelib/doc/snippets')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp | 8 | ||||
-rw-r--r-- | src/corelib/doc/snippets/qstring/main.cpp | 8 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index 01f620cf08..9c07a2e92c 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -372,16 +372,13 @@ a = str.toFloat(&ok); // a == 0, ok == false //! [39] QByteArray text("Qt is great!"); text.toBase64(); // returns "UXQgaXMgZ3JlYXQh" -//! [39] -//! [39bis] QByteArray text("<p>Hello?</p>"); text.toBase64(QByteArray::Base64Encoding | QByteArray::OmitTrailingEquals); // returns "PHA+SGVsbG8/PC9wPg" text.toBase64(QByteArray::Base64Encoding); // returns "PHA+SGVsbG8/PC9wPg==" text.toBase64(QByteArray::Base64UrlEncoding); // returns "PHA-SGVsbG8_PC9wPg==" text.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); // returns "PHA-SGVsbG8_PC9wPg" -//! [39bis] - +//! [39] //! [40] QByteArray ba; @@ -422,9 +419,7 @@ QDataStream in(&data, QIODevice::ReadOnly); //! [44] QByteArray text = QByteArray::fromBase64("UXQgaXMgZ3JlYXQh"); text.data(); // returns "Qt is great!" -//! [44] -//! [44bis] QByteArray::fromBase64("PHA+SGVsbG8/PC9wPg==", QByteArray::Base64Encoding); // returns "<p>Hello?</p>" QByteArray::fromBase64("PHA-SGVsbG8_PC9wPg==", QByteArray::Base64UrlEncoding); // returns "<p>Hello?</p>" //! [44bis] @@ -442,7 +437,6 @@ if (result.decodingStatus == QByteArray::Base64DecodingStatus::Ok) process(result.decoded); //! [44quater] - //! [45] QByteArray text = QByteArray::fromHex("517420697320677265617421"); text.data(); // returns "Qt is great!" diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index ac7fc7d078..f797890e5d 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -433,14 +433,12 @@ void Widget::firstIndexOfFunction() //! [93] QString str = "the minimum"; str.indexOf(QRegularExpression("m[aeiou]"), 0); // returns 4 - //! [93] - //! [99] QString str = "the minimum"; QRegularExpressionMatch match; str.indexOf(QRegularExpression("m[aeiou]"), 0, &match); // returns 4 // match.captured() == mi - //! [99] + //! [93] } void Widget::insertFunction() @@ -490,14 +488,12 @@ void Widget::lastIndexOfFunction() //! [94] QString str = "the minimum"; str.lastIndexOf(QRegularExpression("m[aeiou]")); // returns 8 - //! [94] - //! [100] QString str = "the minimum"; QRegularExpressionMatch match; str.lastIndexOf(QRegularExpression("m[aeiou]"), -1, &match); // returns 8 // match.captured() == mu - //! [100] + //! [94] } void Widget::leftFunction() |