• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

Public Member Functions | Protected Member Functions | Protected Attributes

KRecursiveFilterProxyModel Class Reference

Implements recursive filtering of models. More...

#include <krecursivefilterproxymodel.h>

Inheritance diagram for KRecursiveFilterProxyModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 KRecursiveFilterProxyModel (QObject *parent=0)
virtual ~KRecursiveFilterProxyModel ()
void setSourceModel (QAbstractItemModel *model)

Protected Member Functions

virtual bool acceptRow (int sourceRow, const QModelIndex &sourceParent) const
 Q_PRIVATE_SLOT (d_func(), void sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right)) Q_PRIVATE_SLOT(d_func()
void sourceRowsAboutToBeInserted (const QModelIndex &source_parent, int start, int end)) Q_PRIVATE_SLOT(d_func()
void void void sourceRowsAboutToBeRemoved (const QModelIndex &source_parent, int start, int end)) Q_PRIVATE_SLOT(d_func()
void void sourceRowsInserted (const QModelIndex &source_parent, int start, int end)) Q_PRIVATE_SLOT(d_func()

Protected Attributes

KRecursiveFilterProxyModelPrivate
*const 
d_ptr

Detailed Description

Implements recursive filtering of models.

QSortFilterProxyModel does not recurse when invoking a filtering stage, so that if a particular row is filtered out, its children are not even checked to see if they match the filter.

For example, given a source model:

    - A
    - B
    - - C
    - - - D
    - - - - E
    - - - F
    - - G
    - - H
    - I
  

If a QSortFilterProxyModel is used with a filter matching A, D, G and I, the QSortFilterProxyModel will contain

    - A
    - I
  

That is, even though D and E match the filter, they are not represented in the proxy model because B does not match the filter and is filtered out.

The KRecursiveFilterProxyModel checks child indexes for filter matching and ensures that all matching indexes are represented in the model.

In the above example, the KRecursiveFilterProxyModel will contain

    - A
    - B
    - - C
    - - - D
    - - G
    - I
  

That is, the leaves in the model match the filter, but not necessarily the inner branches.

QSortFilterProxyModel provides the virtual method filterAcceptsRow to allow custom filter implementations. Custom filter implementations can be written for KRecuriveFilterProxyModel using the acceptRow virtual method.

Note that using this proxy model is additional overhead compared to QSortFilterProxyModel as every index in the model must be visited and queried.

Author:
Stephen Kelly <steveire@gmail.com>
Since:
4.5

Definition at line 87 of file krecursivefilterproxymodel.h.


Constructor & Destructor Documentation

KRecursiveFilterProxyModel::KRecursiveFilterProxyModel ( QObject *  parent = 0  ) 

Constructor.

Definition at line 267 of file krecursivefilterproxymodel.cpp.

KRecursiveFilterProxyModel::~KRecursiveFilterProxyModel (  )  [virtual]

Destructor.

Definition at line 273 of file krecursivefilterproxymodel.cpp.


Member Function Documentation

bool KRecursiveFilterProxyModel::acceptRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const [protected, virtual]

Reimplement this method for custom filtering strategies.

Reimplemented in Akonadi::EntityRightsFilterModel.

Definition at line 296 of file krecursivefilterproxymodel.cpp.

void KRecursiveFilterProxyModel::setSourceModel ( QAbstractItemModel *  model  ) 
Reimplemented from superclass.

Definition at line 301 of file krecursivefilterproxymodel.cpp.


The documentation for this class was generated from the following files:
  • krecursivefilterproxymodel.h
  • krecursivefilterproxymodel.cpp

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal