• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • itemviews
kdescendantsproxymodel.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
21#ifndef KDESCENDANTSPROXYMODEL_P_H
22#define KDESCENDANTSPROXYMODEL_P_H
23
24#include <QtGui/QAbstractProxyModel>
25
26class KDescendantsProxyModelPrivate;
27
28#include "kdeui_export.h"
29
70class KDEUI_EXPORT KDescendantsProxyModel : public QAbstractProxyModel
71{
72 Q_OBJECT
73
74 public:
75
81 explicit KDescendantsProxyModel( QObject *parent = 0 );
82
86 virtual ~KDescendantsProxyModel();
87
91 virtual void setSourceModel( QAbstractItemModel *model );
92
98 void setRootIndex( const QModelIndex &index);
99
137 void setDisplayAncestorData( bool display );
138
142 bool displayAncestorData() const;
143
147 void setAncestorSeparator( const QString &separator );
148
152 QString ancestorSeparator() const;
153
157 int descendantCount( const QModelIndex &index ) const;
158
159 QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
160 QModelIndex mapToSource ( const QModelIndex & proxyIndex ) const;
161
162 virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
163 QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
164 virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
165 virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
166
167 virtual QMimeData* mimeData( const QModelIndexList & indexes ) const;
168 virtual QStringList mimeTypes() const;
169
170 virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
171 virtual QModelIndex index(int, int, const QModelIndex &parent = QModelIndex() ) const;
172 virtual QModelIndex parent(const QModelIndex&) const;
173 virtual int columnCount(const QModelIndex& index = QModelIndex()) const;
174
175 virtual Qt::DropActions supportedDropActions() const;
176
180 virtual QModelIndexList match(const QModelIndex& start, int role, const QVariant& value,
181 int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
182
183
184private:
185 Q_DECLARE_PRIVATE( KDescendantsProxyModel )
186 //@cond PRIVATE
187 KDescendantsProxyModelPrivate *d_ptr;
188
189 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &, int, int))
190 Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &, int, int))
191 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &, int, int))
192 Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &, int, int))
193 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))
194 Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))
195 Q_PRIVATE_SLOT(d_func(), void sourceModelAboutToBeReset())
196 Q_PRIVATE_SLOT(d_func(), void sourceModelReset())
197 Q_PRIVATE_SLOT(d_func(), void sourceLayoutAboutToBeChanged())
198 Q_PRIVATE_SLOT(d_func(), void sourceLayoutChanged())
199 Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &, const QModelIndex &))
200 Q_PRIVATE_SLOT(d_func(), void sourceModelDestroyed())
201
202 Q_PRIVATE_SLOT(d_func(), void processPendingParents())
203
204
205 // Make these private, they shouldn't be called by applications
206// virtual bool insertRows(int , int, const QModelIndex & = QModelIndex());
207// virtual bool insertColumns(int, int, const QModelIndex & = QModelIndex());
208// virtual bool removeRows(int, int, const QModelIndex & = QModelIndex());
209// virtual bool removeColumns(int, int, const QModelIndex & = QModelIndex());
210
211
212 //@endcond
213};
214
215#endif
KDescendantsProxyModel::mapFromSource
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
Definition kdescendantsproxymodel.cpp:419
KDescendantsProxyModel::mapToSource
QModelIndex mapToSource(const QModelIndex &proxyIndex) const
Definition kdescendantsproxymodel.cpp:358
KDescendantsProxyModel::index
virtual QModelIndex index(int, int, const QModelIndex &parent=QModelIndex()) const
Definition kdescendantsproxymodel.cpp:347
KDescendantsProxyModel::setSourceModel
virtual void setSourceModel(QAbstractItemModel *model)
Sets the source model of the proxy.
Definition kdescendantsproxymodel.cpp:258
KDescendantsProxyModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition kdescendantsproxymodel.cpp:521
KDescendantsProxyModel::setAncestorSeparator
void setAncestorSeparator(const QString &separator)
Sets the ancestor separator used between data of ancestors.
Definition kdescendantsproxymodel.cpp:245
KDescendantsProxyModel::setRootIndex
void setRootIndex(const QModelIndex &index)
Definition kdescendantsproxymodel.cpp:223
KDescendantsProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Definition kdescendantsproxymodel.cpp:327
KDescendantsProxyModel::setDisplayAncestorData
void setDisplayAncestorData(bool display)
Set whether to show ancestor data in the model.
Definition kdescendantsproxymodel.cpp:233
KDescendantsProxyModel::match
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
Reimplemented to match all descendants.
Definition kdescendantsproxymodel.cpp:228
KDescendantsProxyModel::columnCount
virtual int columnCount(const QModelIndex &index=QModelIndex()) const
Definition kdescendantsproxymodel.cpp:481
KDescendantsProxyModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition kdescendantsproxymodel.cpp:529
KDescendantsProxyModel::mimeTypes
virtual QStringList mimeTypes() const
Definition kdescendantsproxymodel.cpp:992
KDescendantsProxyModel::mimeData
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Definition kdescendantsproxymodel.cpp:981
KDescendantsProxyModel::supportedDropActions
virtual Qt::DropActions supportedDropActions() const
Definition kdescendantsproxymodel.cpp:1000
KDescendantsProxyModel::descendantCount
int descendantCount(const QModelIndex &index) const
Returns the number of descendant entries for the given model index.
KDescendantsProxyModel::parent
virtual QModelIndex parent(const QModelIndex &) const
Definition kdescendantsproxymodel.cpp:321
KDescendantsProxyModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition kdescendantsproxymodel.cpp:489
KDescendantsProxyModel::KDescendantsProxyModel
KDescendantsProxyModel(QObject *parent=0)
Creates a new descendant entities proxy model.
Definition kdescendantsproxymodel.cpp:213
KDescendantsProxyModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition kdescendantsproxymodel.cpp:333
KDescendantsProxyModel::displayAncestorData
bool displayAncestorData() const
Whether ancestor data will be displayed.
Definition kdescendantsproxymodel.cpp:239
KDescendantsProxyModel::ancestorSeparator
QString ancestorSeparator() const
Separator used between data of ancestors.
Definition kdescendantsproxymodel.cpp:251
QAbstractItemModel
QAbstractProxyModel
QObject
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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