summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-08-01 00:07:11 +0200
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-08-16 16:30:14 +0000
commit30b0701c9b50ec718ec858d7777a01c66e333a9c (patch)
tree21f5eb38257aaa50ab18b4ae9d1e644170f8efbe /src/corelib/doc
parent0f6b941ca54f9714627b8d5a94be163dc02126c1 (diff)
Refactor wildcard support in QRegularExpression
The API originally proposed was flawed in the sense that the setter function would use a modified version of the parameter given which would have make it a black box for the user. This patch fixes that by removing that setter and providing a static method that will return the pattern suitably modified to be used by QRegularExpression the same way the escape method does. [ChangeLog][Core][QRegularExpression] Implemented support for wildcard patterns through a static method. Change-Id: I0054bcaffd7525dac569f54fa81f73b7e4544b2e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/doc')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
index 5f0a175374..28c66628b7 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
@@ -350,4 +350,11 @@ while (i.hasNext()) {
//! [30]
}
+{
+//! [31]
+QString wildcard = QRegularExpression::wildcardToRegularExpression("*.jpeg");
+// wilcard == ".*\.jpeg"
+//! [31]
+}
+
}