• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

akonadi_next

  • sources
  • kde-4.12
  • kdepim
  • akonadi_next
kreparentingproxymodel.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef KREPARENTINGPROXYMODEL_H
21 #define KREPARENTINGPROXYMODEL_H
22 
23 #include <QAbstractProxyModel>
24 
25 class KReparentingProxyModelPrivate;
26 
74 class KReparentingProxyModel : public QAbstractProxyModel
75 {
76  Q_OBJECT
77 public:
78  explicit KReparentingProxyModel(QObject* parent = 0);
79  ~KReparentingProxyModel();
80 
81  virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
82 
83  virtual QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
84 
85  virtual void setSourceModel(QAbstractItemModel* sourceModel);
86 
90  virtual bool isDescendantOf(const QModelIndex& ancestor, const QModelIndex& descendant ) const;
91 
92  virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
93 
94  virtual QVariant data(const QModelIndex& proxyIndex, int role = Qt::DisplayRole) const;
95 
96  virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
97 
98  virtual QModelIndex parent(const QModelIndex& child) const;
99 
100  virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
101 
102  virtual bool hasChildren(const QModelIndex& parent = QModelIndex()) const;
103 
104  virtual Qt::DropActions supportedDropActions() const;
105 
106 
107 private:
108  Q_DECLARE_PRIVATE(KReparentingProxyModel)
109  //@cond PRIVATE
110  KReparentingProxyModelPrivate *d_ptr;
111 
112  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &, int, int))
113  Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &, int, int))
114  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &, int, int))
115  Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &, int, int))
116  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))
117  Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))
118  Q_PRIVATE_SLOT(d_func(), void sourceModelAboutToBeReset())
119  Q_PRIVATE_SLOT(d_func(), void sourceModelReset())
120  Q_PRIVATE_SLOT(d_func(), void sourceLayoutAboutToBeChanged())
121  Q_PRIVATE_SLOT(d_func(), void sourceLayoutChanged())
122  Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &, const QModelIndex &))
123 
124  //@endcond
125 
126 
127 };
128 
129 
130 #endif
KReparentingProxyModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: kreparentingproxymodel.cpp:671
KReparentingProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Definition: kreparentingproxymodel.cpp:692
QObject
KReparentingProxyModel::parent
virtual QModelIndex parent(const QModelIndex &child) const
Definition: kreparentingproxymodel.cpp:619
KReparentingProxyModel::~KReparentingProxyModel
~KReparentingProxyModel()
Definition: kreparentingproxymodel.cpp:441
KReparentingProxyModel
Restructures a source model, changing the parents of items.
Definition: kreparentingproxymodel.h:74
KReparentingProxyModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: kreparentingproxymodel.cpp:588
KReparentingProxyModel::isDescendantOf
virtual bool isDescendantOf(const QModelIndex &ancestor, const QModelIndex &descendant) const
Reimplement this to return whether descendant is a descendant of ancestor.
Definition: kreparentingproxymodel.cpp:463
KReparentingProxyModel::data
virtual QVariant data(const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const
Definition: kreparentingproxymodel.cpp:583
KReparentingProxyModel::mapToSource
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
Definition: kreparentingproxymodel.cpp:503
KReparentingProxyModel::mapFromSource
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
Definition: kreparentingproxymodel.cpp:470
QAbstractProxyModel
KReparentingProxyModel::supportedDropActions
virtual Qt::DropActions supportedDropActions() const
Definition: kreparentingproxymodel.cpp:1462
KReparentingProxyModel::columnCount
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: kreparentingproxymodel.cpp:566
KReparentingProxyModel::setSourceModel
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Definition: kreparentingproxymodel.cpp:697
KReparentingProxyModel::KReparentingProxyModel
KReparentingProxyModel(QObject *parent=0)
Definition: kreparentingproxymodel.cpp:435
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:54:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi_next

Skip menu "akonadi_next"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal