Qt Utilities  5.6.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
optioncategoryfiltermodel.cpp
Go to the documentation of this file.
3 #include "./optioncategory.h"
4 
5 namespace Dialogs {
6 
16  QSortFilterProxyModel(parent)
17 {}
18 
19 bool OptionCategoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
20 {
21  if (QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent))
22  return true;
23  if(OptionCategoryModel *model = qobject_cast<OptionCategoryModel *>(sourceModel())) {
24  if(OptionCategory *category = model->category(sourceRow)) {
25  return category->matches(filterRegExp().pattern());
26  }
27  }
28  return false;
29 }
30 
31 }
virtual bool filterAcceptsRow(int source_row, const QModelIndex &sourceParent) const
The OptionCategoryModel class is used by SettingsDialog to store and display option categories...
The OptionCategory class wraps associated option pages.
OptionCategoryFilterModel(QObject *parent=nullptr)
Constructs an option category filter model.
Provides common dialogs such as AboutDialog, EnterPasswordDialog and SettingsDialog.
Definition: dialogutils.h:12