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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
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 <QAbstractProxyModel>
25 
26 #include "marble_export.h"
27 
28 class KDescendantsProxyModelPrivate;
29 
69 class MARBLE_EXPORT KDescendantsProxyModel : public QAbstractProxyModel
70 {
71  Q_OBJECT
72 
73  public:
74 
80  explicit KDescendantsProxyModel( QObject *parent = 0 );
81 
85  virtual ~KDescendantsProxyModel();
86 
90  virtual void setSourceModel( QAbstractItemModel *model );
91 
100  void setRootIndex( const QModelIndex &index);
101 
139  void setDisplayAncestorData( bool display );
140 
144  bool displayAncestorData() const;
145 
149  void setAncestorSeparator( const QString &separator );
150 
154  QString ancestorSeparator() const;
155 
159  int descendantCount( const QModelIndex &index ) const;
160 
161  QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
162  QModelIndex mapToSource ( const QModelIndex & proxyIndex ) const;
163 
164  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
165  QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
166  virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
167  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
168 
169  virtual QMimeData* mimeData( const QModelIndexList & indexes ) const;
170  virtual QStringList mimeTypes() const;
171 
172  virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
173  virtual QModelIndex index(int, int, const QModelIndex &parent = QModelIndex() ) const;
174  virtual QModelIndex parent(const QModelIndex&) const;
175  virtual int columnCount(const QModelIndex& index = QModelIndex()) const;
176 
177  virtual Qt::DropActions supportedDropActions() const;
178 
182  virtual QModelIndexList match(const QModelIndex& start, int role, const QVariant& value,
183  int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
184 
185 
186 private:
187  Q_DECLARE_PRIVATE( KDescendantsProxyModel )
188  //@cond PRIVATE
189  KDescendantsProxyModelPrivate *d_ptr;
190 
191  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &, int, int))
192  Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &, int, int))
193  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &, int, int))
194  Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &, int, int))
195  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))
196  Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))
197  Q_PRIVATE_SLOT(d_func(), void sourceModelAboutToBeReset())
198  Q_PRIVATE_SLOT(d_func(), void sourceModelReset())
199  Q_PRIVATE_SLOT(d_func(), void sourceLayoutAboutToBeChanged())
200  Q_PRIVATE_SLOT(d_func(), void sourceLayoutChanged())
201  Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &, const QModelIndex &))
202  Q_PRIVATE_SLOT(d_func(), void sourceModelDestroyed())
203 
204  Q_PRIVATE_SLOT(d_func(), void processPendingParents())
205 
206 
207  // Make these private, they shouldn't be called by applications
208 // virtual bool insertRows(int , int, const QModelIndex & = QModelIndex());
209 // virtual bool insertColumns(int, int, const QModelIndex & = QModelIndex());
210 // virtual bool removeRows(int, int, const QModelIndex & = QModelIndex());
211 // virtual bool removeColumns(int, int, const QModelIndex & = QModelIndex());
212 
213 
214  //@endcond
215 };
216 
217 #endif
KDescendantsProxyModel
Proxy Model for restructuring a Tree into a list.
Definition: kdescendantsproxymodel.h:69
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractItemModel
QAbstractProxyModel
marble_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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