Qt Utilities  5.11.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.
2 #include "./optioncategory.h"
4 
5 namespace Dialogs {
6 
17  : QSortFilterProxyModel(parent)
18 {
19 }
20 
21 bool OptionCategoryFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
22 {
23  if (QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent))
24  return true;
25  if (OptionCategoryModel *model = qobject_cast<OptionCategoryModel *>(sourceModel())) {
26  if (OptionCategory *category = model->category(sourceRow)) {
27  return category->matches(filterRegExp().pattern());
28  }
29  }
30  return false;
31 }
32 } // namespace Dialogs
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