Sort Model regExp Error.
-
wrote on 2 May 2019, 09:23 last edited by
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?
-
wrote on 2 May 2019, 11:41 last edited by
- use
QRegularExpression
instread ofQRegExp
- https://www.regular-expressions.info/lookaround.html
If the above is not enough use 2 separate proxys one for the
A
part and this one for thenot B
part - use
-
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?
wrote on 2 May 2019, 11:56 last edited by JonB 5 Feb 2019, 11:59@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
QRegularExpression
instread ofQRegExp
- https://www.regular-expressions.info/lookaround.html
If the above is not enough use 2 separate proxys one for the
A
part and this one for thenot B
part - use
-
wrote on 3 May 2019, 07:20 last edited by
Your current program:
source model ->QSortFilterProxyModel
with"A | [^ (B)]"
as filter ->viewwhat we are suggesting:
source model ->QSortFilterProxyModel
with"A"
as filter -> NegativeSortFilterProxyModel with"B"
as a filter ->view
1/5