diff options
Diffstat (limited to 'src/corelib/doc')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp | 6 | ||||
-rw-r--r-- | src/corelib/doc/snippets/qstring/main.cpp | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp index 7f42cd8def..278a00fdfd 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp @@ -106,3 +106,9 @@ if (event->mimeData()->hasColor()) { ... } //! [7] + + +//! [8] +application/x-qt-windows-mime;value="FileContents";index=0 +application/x-qt-windows-mime;value="FileContents";index=1 +//! [8] diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index f49c4dd359..17d0adf097 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -394,6 +394,13 @@ void Widget::firstIndexOfFunction() QString str = "the minimum"; str.indexOf(QRegularExpression("m[aeiou]"), 0); // returns 4 //! [93] + + //! [97] + QString str = "the minimum"; + QRegularExpressionMatch match; + str.indexOf(QRegularExpression("m[aeiou]"), 0, &match); // returns 4 + // match.captured() == mi + //! [97] } void Widget::insertFunction() @@ -444,6 +451,13 @@ void Widget::lastIndexOfFunction() QString str = "the minimum"; str.lastIndexOf(QRegularExpression("m[aeiou]")); // returns 8 //! [94] + + //! [98] + QString str = "the minimum"; + QRegularExpressionMatch match; + str.lastIndexOf(QRegularExpression("m[aeiou]"), -1, &match); // returns 8 + // match.captured() == mu + //! [98] } void Widget::leftFunction() |