Solved Qt QRegExp not work ..
-
QString filterA = "numAttribute";
QString filterB = "textAttribute";
QString filterC = QString("%1|%2").arg(filterA),arg(filterB);QRegExp regExp(filterA | filterB, Qt::CaseInsensitive, QRegExp::Wildcard);
this not work.QRegExp regExp(filterC, Qt::CaseInsensitive, QRegExp::Wildcard);
this not work.how use, filterA or filterB filer in listModel(treeModel) ??
-
@Pada_ Hi,
You are using your RegExp in Wildcard mode.
tryQRegExp regExp(filterC, Qt::CaseInsensitive, QRegExp::RegExp); //or QRegExp regExp(filterC, Qt::CaseInsensitive, QRegExp::RegExp2); //greedy quantifier
-
-
QRegularExpression is not setting sortModel..
-
@Pada_ said in Qt QRegExp not work ..:
QRegularExpression is not setting sortModel..
What do you mean?
-
QRegularExpression regExp ("text");
sortModel-> setFilterRegExp (regexp);
Can not be set in the model.
lineedit
A, BI want to filter only A or B and show it in sortModel ....
-
Hi,
What exactly are you try to filter on your model ?
You should give examples of what you have and what you expect. -
Hello..
An attribute is a name and a value.
If you write the value of the attribute name = attribute
I want to show it in sortModel.
Even if you do not use the name of an attribute,
or
Even if you do not use the value of the attribute,
I want to show something similar (containing).
-
What is "attribute" for you ?
Again, please provide concrete examples.