KDEUI
kdescendantsproxymodel.h
Go to the documentation of this file.
00001 /* 00002 Copyright (c) 2009 Stephen Kelly <steveire@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 00021 #ifndef KDESCENDANTSPROXYMODEL_P_H 00022 #define KDESCENDANTSPROXYMODEL_P_H 00023 00024 #include <QtGui/QAbstractProxyModel> 00025 00026 class KDescendantsProxyModelPrivate; 00027 00028 #include "kdeui_export.h" 00029 00069 class KDEUI_EXPORT KDescendantsProxyModel : public QAbstractProxyModel 00070 { 00071 Q_OBJECT 00072 00073 public: 00074 00080 explicit KDescendantsProxyModel( QObject *parent = 0 ); 00081 00085 virtual ~KDescendantsProxyModel(); 00086 00090 virtual void setSourceModel( QAbstractItemModel *model ); 00091 00100 void setRootIndex( const QModelIndex &index); 00101 00139 void setDisplayAncestorData( bool display ); 00140 00144 bool displayAncestorData() const; 00145 00149 void setAncestorSeparator( const QString &separator ); 00150 00154 QString ancestorSeparator() const; 00155 00159 int descendantCount( const QModelIndex &index ) const; 00160 00161 QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const; 00162 QModelIndex mapToSource ( const QModelIndex & proxyIndex ) const; 00163 00164 virtual Qt::ItemFlags flags( const QModelIndex &index ) const; 00165 QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const; 00166 virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const; 00167 virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; 00168 00169 virtual QMimeData* mimeData( const QModelIndexList & indexes ) const; 00170 virtual QStringList mimeTypes() const; 00171 00172 virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const; 00173 virtual QModelIndex index(int, int, const QModelIndex &parent = QModelIndex() ) const; 00174 virtual QModelIndex parent(const QModelIndex&) const; 00175 virtual int columnCount(const QModelIndex& index = QModelIndex()) const; 00176 00177 virtual Qt::DropActions supportedDropActions() const; 00178 00182 virtual QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, 00183 int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const; 00184 00185 00186 private: 00187 Q_DECLARE_PRIVATE( KDescendantsProxyModel ) 00188 //@cond PRIVATE 00189 KDescendantsProxyModelPrivate *d_ptr; 00190 00191 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &, int, int)) 00192 Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &, int, int)) 00193 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &, int, int)) 00194 Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &, int, int)) 00195 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)) 00196 Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)) 00197 Q_PRIVATE_SLOT(d_func(), void sourceModelAboutToBeReset()) 00198 Q_PRIVATE_SLOT(d_func(), void sourceModelReset()) 00199 Q_PRIVATE_SLOT(d_func(), void sourceLayoutAboutToBeChanged()) 00200 Q_PRIVATE_SLOT(d_func(), void sourceLayoutChanged()) 00201 Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &, const QModelIndex &)) 00202 Q_PRIVATE_SLOT(d_func(), void sourceModelDestroyed()) 00203 00204 Q_PRIVATE_SLOT(d_func(), void processPendingParents()) 00205 00206 00207 // Make these private, they shouldn't be called by applications 00208 // virtual bool insertRows(int , int, const QModelIndex & = QModelIndex()); 00209 // virtual bool insertColumns(int, int, const QModelIndex & = QModelIndex()); 00210 // virtual bool removeRows(int, int, const QModelIndex & = QModelIndex()); 00211 // virtual bool removeColumns(int, int, const QModelIndex & = QModelIndex()); 00212 00213 00214 //@endcond 00215 }; 00216 00217 #endif
KDE 4.6 API Reference