I've created a SortFilterProxyModel
together with a QStandardItemModel
and a QTreeView
. I need to only show rows, where the second column is equal to one of the values in my QStringList
. Can anyone tell me how to do this? I thought of setFilterFixedString
, but this only works for a single QString
, not for a List...
My Code:
#include "dicomtagsproxymodel.h"
DicomTagsProxyModel::DicomTagsProxyModel(QObject *parent) : QSortFilterProxyModel(parent)
{
}
DicomTagsProxyModel::~DicomTagsProxyModel(void)
{
}
bool DicomTagsProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
if (sourceModel()->data(index1).toString() == HOW TO GET THE VALUES OF MY STRINGLIST HERE?)
}