patcito
7th July 2006, 21:49
Hey all,
I´m using a QSortFilterProxyModel to search through my QtreeWidget like this:
QAbstractItemModel * sourceModel;
sourceModel = ui.treeWidget->model();
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(sourceModel);
ui.treeWidget->QtreeWidget::setModel(proxyModel);
proxyModel->setFilterRegExp(QRegExp(".png", Qt::CaseInsensitive,QRegExp::FixedString));
The problem is that as the documentation says:
"For hierarchical models, the filter is applied recursively to all
children. If a parent item doesn't match the filter, none of its
children will be shown."
I would like all parent items to be shown as long as one of their
children match the filter or of course if the parent itself matches
the filter. Kind of like how the collection tab in amarok works. Any
idea how could I do that?
thanx in advance
Pat
I´m using a QSortFilterProxyModel to search through my QtreeWidget like this:
QAbstractItemModel * sourceModel;
sourceModel = ui.treeWidget->model();
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(sourceModel);
ui.treeWidget->QtreeWidget::setModel(proxyModel);
proxyModel->setFilterRegExp(QRegExp(".png", Qt::CaseInsensitive,QRegExp::FixedString));
The problem is that as the documentation says:
"For hierarchical models, the filter is applied recursively to all
children. If a parent item doesn't match the filter, none of its
children will be shown."
I would like all parent items to be shown as long as one of their
children match the filter or of course if the parent itself matches
the filter. Kind of like how the collection tab in amarok works. Any
idea how could I do that?
thanx in advance
Pat