Fix some qdoc warnings: QRegularExpression parameters

Change-Id: Ib4d33327c6c059e11d8615bac0f72d9f028d5860
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Volker Hilsheimer 2020-09-22 17:13:34 +02:00
parent 25cc901f04
commit 6db7aceb43
2 changed files with 8 additions and 6 deletions

View File

@ -1793,7 +1793,7 @@ QString QRegularExpression::escape(QStringView str)
#if QT_STRINGVIEW_LEVEL < 2 #if QT_STRINGVIEW_LEVEL < 2
/*! /*!
\since 5.12 \since 5.12
\fn QString QRegularExpression::wildcardToRegularExpression(const QString &pattern, WildcardConversionType type) \fn QString QRegularExpression::wildcardToRegularExpression(const QString &pattern, WildcardConversionOptions options)
\overload \overload
*/ */
#endif // QT_STRINGVIEW_LEVEL < 2 #endif // QT_STRINGVIEW_LEVEL < 2
@ -1826,7 +1826,7 @@ QString QRegularExpression::escape(QStringView str)
By default, the returned regular expression is fully anchored. In other By default, the returned regular expression is fully anchored. In other
words, there is no need of calling anchoredPattern() again on the words, there is no need of calling anchoredPattern() again on the
result. To get an a regular expression that is not anchored, pass result. To get an a regular expression that is not anchored, pass
UnanchoredWildcardConversion as the conversion \a option. UnanchoredWildcardConversion as the conversion \a options.
This implementation follows closely the definition This implementation follows closely the definition
of wildcard for glob patterns: of wildcard for glob patterns:
@ -1947,7 +1947,9 @@ QString QRegularExpression::wildcardToRegularExpression(QStringView pattern, Wil
/*! /*!
\since 6.0 \since 6.0
Returns a regular expression of the glob pattern \a pattern. Returns a regular expression of the glob pattern \a pattern. The regular expression
will be case sensitive if \a cs is \l{Qt::CaseSensitive}, and converted according to
\a options.
Equivalent to Equivalent to
\code \code
@ -1956,12 +1958,12 @@ QString QRegularExpression::wildcardToRegularExpression(QStringView pattern, Wil
return QRegularExpression(wildcardToRegularExpression(str, options), reOptions); return QRegularExpression(wildcardToRegularExpression(str, options), reOptions);
\endcode \endcode
*/ */
QRegularExpression QRegularExpression::fromWildcard(QStringView str, Qt::CaseSensitivity cs, QRegularExpression QRegularExpression::fromWildcard(QStringView pattern, Qt::CaseSensitivity cs,
WildcardConversionOptions options) WildcardConversionOptions options)
{ {
auto reOptions = cs == Qt::CaseSensitive ? QRegularExpression::NoPatternOption : auto reOptions = cs == Qt::CaseSensitive ? QRegularExpression::NoPatternOption :
QRegularExpression::CaseInsensitiveOption; QRegularExpression::CaseInsensitiveOption;
return QRegularExpression(wildcardToRegularExpression(str, options), reOptions); return QRegularExpression(wildcardToRegularExpression(pattern, options), reOptions);
} }
#if QT_STRINGVIEW_LEVEL < 2 #if QT_STRINGVIEW_LEVEL < 2

View File

@ -166,7 +166,7 @@ public:
static QString wildcardToRegularExpression(QStringView str, WildcardConversionOptions options = DefaultWildcardConversion); static QString wildcardToRegularExpression(QStringView str, WildcardConversionOptions options = DefaultWildcardConversion);
static QString anchoredPattern(QStringView expression); static QString anchoredPattern(QStringView expression);
static QRegularExpression fromWildcard(QStringView str, Qt::CaseSensitivity cs = Qt::CaseInsensitive, static QRegularExpression fromWildcard(QStringView pattern, Qt::CaseSensitivity cs = Qt::CaseInsensitive,
WildcardConversionOptions options = DefaultWildcardConversion); WildcardConversionOptions options = DefaultWildcardConversion);
bool operator==(const QRegularExpression &re) const; bool operator==(const QRegularExpression &re) const;