refactor: copy PatternSyntax enum to RegExpFilter
This commit is contained in:
parent
598bd7295b
commit
1c0731a38c
|
@ -162,12 +162,12 @@ void RegExpFilter::setPattern(const QString& pattern)
|
|||
filterChanged();
|
||||
}
|
||||
|
||||
QQmlSortFilterProxyModel::PatternSyntax RegExpFilter::syntax() const
|
||||
RegExpFilter::PatternSyntax RegExpFilter::syntax() const
|
||||
{
|
||||
return m_syntax;
|
||||
}
|
||||
|
||||
void RegExpFilter::setSyntax(QQmlSortFilterProxyModel::PatternSyntax syntax)
|
||||
void RegExpFilter::setSyntax(RegExpFilter::PatternSyntax syntax)
|
||||
{
|
||||
if (m_syntax == syntax)
|
||||
return;
|
||||
|
|
17
filter.h
17
filter.h
|
@ -114,17 +114,26 @@ private:
|
|||
class RegExpFilter : public RoleFilter {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString pattern READ pattern WRITE setPattern NOTIFY patternChanged)
|
||||
Q_PROPERTY(QQmlSortFilterProxyModel::PatternSyntax syntax READ syntax WRITE setSyntax NOTIFY syntaxChanged)
|
||||
Q_PROPERTY(PatternSyntax syntax READ syntax WRITE setSyntax NOTIFY syntaxChanged)
|
||||
Q_PROPERTY(Qt::CaseSensitivity caseSensitivity READ caseSensitivity WRITE setCaseSensitivity NOTIFY caseSensitivityChanged)
|
||||
|
||||
public:
|
||||
enum PatternSyntax {
|
||||
RegExp = QRegExp::RegExp,
|
||||
Wildcard = QRegExp::Wildcard,
|
||||
FixedString = QRegExp::FixedString,
|
||||
RegExp2 = QRegExp::RegExp2,
|
||||
WildcardUnix = QRegExp::WildcardUnix,
|
||||
W3CXmlSchema11 = QRegExp::W3CXmlSchema11 };
|
||||
Q_ENUMS(PatternSyntax)
|
||||
|
||||
using RoleFilter::RoleFilter;
|
||||
|
||||
QString pattern() const;
|
||||
void setPattern(const QString& pattern);
|
||||
|
||||
QQmlSortFilterProxyModel::PatternSyntax syntax() const;
|
||||
void setSyntax(QQmlSortFilterProxyModel::PatternSyntax syntax);
|
||||
PatternSyntax syntax() const;
|
||||
void setSyntax(PatternSyntax syntax);
|
||||
|
||||
Qt::CaseSensitivity caseSensitivity() const;
|
||||
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity);
|
||||
|
@ -140,7 +149,7 @@ Q_SIGNALS:
|
|||
private:
|
||||
QRegExp m_regExp;
|
||||
Qt::CaseSensitivity m_caseSensitivity = m_regExp.caseSensitivity();
|
||||
QQmlSortFilterProxyModel::PatternSyntax m_syntax = static_cast<QQmlSortFilterProxyModel::PatternSyntax>(m_regExp.patternSyntax());
|
||||
PatternSyntax m_syntax = static_cast<PatternSyntax>(m_regExp.patternSyntax());
|
||||
QString m_pattern = m_regExp.pattern();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue