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

marble

  • sources
  • kde-4.14
  • 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 
129  void setDisplayAncestorData( bool display );
130 
134  bool displayAncestorData() const;
135 
139  void setAncestorSeparator( const QString &separator );
140 
144  QString ancestorSeparator() const;
145 
149  int descendantCount( const QModelIndex &index ) const;
150 
151  QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
152  QModelIndex mapToSource ( const QModelIndex & proxyIndex ) const;
153 
154  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
155  QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
156  virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
157  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
158 
159  virtual QMimeData* mimeData( const QModelIndexList & indexes ) const;
160  virtual QStringList mimeTypes() const;
161 
162  virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
163  virtual QModelIndex index(int, int, const QModelIndex &parent = QModelIndex() ) const;
164  virtual QModelIndex parent(const QModelIndex&) const;
165  virtual int columnCount(const QModelIndex& index = QModelIndex()) const;
166 
167  virtual Qt::DropActions supportedDropActions() const;
168 
172  virtual QModelIndexList match(const QModelIndex& start, int role, const QVariant& value,
173  int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
174 
175 
176 private:
177  Q_DECLARE_PRIVATE( KDescendantsProxyModel )
178  //@cond PRIVATE
179  KDescendantsProxyModelPrivate *d_ptr;
180 
181  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeInserted(const QModelIndex &, int, int))
182  Q_PRIVATE_SLOT(d_func(), void sourceRowsInserted(const QModelIndex &, int, int))
183  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeRemoved(const QModelIndex &, int, int))
184  Q_PRIVATE_SLOT(d_func(), void sourceRowsRemoved(const QModelIndex &, int, int))
185  Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))
186  Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))
187  Q_PRIVATE_SLOT(d_func(), void sourceModelAboutToBeReset())
188  Q_PRIVATE_SLOT(d_func(), void sourceModelReset())
189  Q_PRIVATE_SLOT(d_func(), void sourceLayoutAboutToBeChanged())
190  Q_PRIVATE_SLOT(d_func(), void sourceLayoutChanged())
191  Q_PRIVATE_SLOT(d_func(), void sourceDataChanged(const QModelIndex &, const QModelIndex &))
192  Q_PRIVATE_SLOT(d_func(), void sourceModelDestroyed())
193 
194  Q_PRIVATE_SLOT(d_func(), void processPendingParents())
195 
196 
197  // Make these private, they shouldn't be called by applications
198 // virtual bool insertRows(int , int, const QModelIndex & = QModelIndex());
199 // virtual bool insertColumns(int, int, const QModelIndex & = QModelIndex());
200 // virtual bool removeRows(int, int, const QModelIndex & = QModelIndex());
201 // virtual bool removeColumns(int, int, const QModelIndex & = QModelIndex());
202 
203 
204  //@endcond
205 };
206 
207 #endif
QModelIndex
QAbstractItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const =0
QAbstractItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
KDescendantsProxyModel
Proxy Model for restructuring a Tree into a list.
Definition: kdescendantsproxymodel.h:69
QAbstractProxyModel
QAbstractProxyModel::supportedDropActions
virtual Qt::DropActions supportedDropActions() const
Qt::MatchFlags
typedef MatchFlags
QAbstractProxyModel::mimeData
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
QMimeData
QAbstractItemModel::match
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
QAbstractProxyModel::hasChildren
virtual bool hasChildren(const QModelIndex &parent) const
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractProxyModel::setSourceModel
virtual void setSourceModel(QAbstractItemModel *sourceModel)
QString
QAbstractProxyModel::data
virtual QVariant data(const QModelIndex &proxyIndex, int role) const
QStringList
QAbstractProxyModel::mimeTypes
virtual QStringList mimeTypes() const
marble_export.h
Qt::DropActions
typedef DropActions
QAbstractProxyModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
QAbstractProxyModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
QAbstractItemModel::columnCount
virtual int columnCount(const QModelIndex &parent) const =0
QAbstractItemModel
QAbstractProxyModel::mapFromSource
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const =0
QAbstractProxyModel::mapToSource
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const =0
QObject::parent
QObject * parent() const
QVariant
Qt::ItemFlags
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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
  • 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