Nightfox
17th February 2010, 20:39
I'm trying to filter out items from a soruce model (model) with the following values in the FilterKeyColumn;
BALA,DRIF,120,5000
I want to filter out the BALA row using QRegExp leaving the model with three items. I've tried using the following regular expression but it either retruns all four rows or no rows
QSortFilterProxyModel *filterproxy = new QSortFilterProxyModel(this);
filterproxy->setSourceModel(model);
filterproxy->setFilterKeyColumn(1);
filterproxy->setFilterRegExp(QRegExp("(?!bala)",Qt::CaseInsensitive,QRegExp::FixedString) );
tableview->setModel(proxymodel);
Basically what I want to do is to show all rows in the model except the row that has "bala" value in the FilterKeyColumn. The Qt Assistant is not really clear about negative expressions or how to apply a NOT validator.
Can somebody help?
BALA,DRIF,120,5000
I want to filter out the BALA row using QRegExp leaving the model with three items. I've tried using the following regular expression but it either retruns all four rows or no rows
QSortFilterProxyModel *filterproxy = new QSortFilterProxyModel(this);
filterproxy->setSourceModel(model);
filterproxy->setFilterKeyColumn(1);
filterproxy->setFilterRegExp(QRegExp("(?!bala)",Qt::CaseInsensitive,QRegExp::FixedString) );
tableview->setModel(proxymodel);
Basically what I want to do is to show all rows in the model except the row that has "bala" value in the FilterKeyColumn. The Qt Assistant is not really clear about negative expressions or how to apply a NOT validator.
Can somebody help?