Sort Model regExp Error.
-
-
QRegExp regExp (regExpStr, Qt :: CaseInsensitive, QRegExp :: RegExp2);
sortModel-> setFilterRegExp (regExp);Is used.
I want to create a regExp that contains A in regExpStr but not B.
So I did A | [^ (B)] but it does not respond. What should I do?
@Pada_ said in Sort Model regExp Error.:
[^ (B)]That means: not one of the characters:
space,(,B,). Probably nothing like what you want. And the|for "or" does not correspond to "contains A in regExpStr but not B." Might be simpler to follow @VRonin's suggestion of two separate proxies. -
- use
QRegularExpressioninstread ofQRegExp - https://www.regular-expressions.info/lookaround.html
If the above is not enough use 2 separate proxys one for the
Apart and this one for thenot Bpart - use
-
Your current program:
source model ->QSortFilterProxyModelwith"A | [^ (B)]"as filter ->viewwhat we are suggesting:
source model ->QSortFilterProxyModelwith"A"as filter -> NegativeSortFilterProxyModel with"B"as a filter ->view