Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Jan 10 2020, 6:09 PM.

Details

Summary

QSortFilterProxyModel::setFilterFixedString() internally uses QRegExp
with QRegExp::FixedString syntax option; setFilterFixedString() was
ported by using setFilterRegularExpression(QRegularExpression::escape(string)),
this isn't perfect since QRegularExpression::escape() follows Perl quotemeta
algorithm, basically it escapes all characters in the pattern except for [A-Z],
[a-z], [0-9] and _; so for example a space ' ' is escaped too. See QRegularExpression
docs for the details.

Replace QSortFilterProxyModel::filterRegExp() with filterRegularExpression(),
the same for the relevant setters. Raise min. required Qt version to 5.12,
as that is where filterRegularExpression() was introduced.

Test Plan

make && ctest; some unit tests fail but they fail on master too.

Diff Detail

Repository
R4 Zanshin
Branch
l-qregular (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20914
Build 20932: arc lint + arc unit
ahmadsamir requested review of this revision.Jan 10 2020, 6:09 PM
ahmadsamir created this revision.
ahmadsamir updated this revision to Diff 73224.Jan 10 2020, 6:51 PM
ahmadsamir edited the summary of this revision. (Show Details)

Fix commit message\n Raise min. Qt version

ahmadsamir updated this revision to Diff 73253.Jan 11 2020, 9:43 AM

Link to KF6 task

ahmadsamir updated this revision to Diff 73255.Jan 11 2020, 9:48 AM

Wrong task

ervin accepted this revision.Jan 20 2020, 1:19 PM
This revision is now accepted and ready to land.Jan 20 2020, 1:19 PM
This revision was automatically updated to reflect the committed changes.