• 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
GeoDataTreeModel.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2010 Thibaut Gridel <tgridel@free.fr>
9 //
10 
11 #ifndef MARBLE_GEODATATREEMODEL_H
12 #define MARBLE_GEODATATREEMODEL_H
13 
14 #include "marble_export.h"
15 
16 #include <QAbstractItemModel>
17 
18 class QItemSelectionModel;
19 
20 namespace Marble
21 {
22 class GeoDataObject;
23 class GeoDataDocument;
24 class GeoDataFeature;
25 class GeoDataContainer;
26 
27 
32 class MARBLE_EXPORT GeoDataTreeModel : public QAbstractItemModel
33 {
34  Q_OBJECT
35 
36  public:
37 
43  explicit GeoDataTreeModel( QObject *parent = 0 );
44 
48  ~GeoDataTreeModel();
49 
50  virtual bool hasChildren( const QModelIndex &parent ) const;
51 
55  int rowCount( const QModelIndex &parent = QModelIndex() ) const;
56 
57  QVariant headerData(int section, Qt::Orientation orientation,
58  int role = Qt::DisplayRole) const;
59 
60  QVariant data( const QModelIndex &index, int role ) const;
61 
62  QModelIndex index( int row, int column,
63  const QModelIndex &parent = QModelIndex() ) const;
64 
65  QModelIndex index( GeoDataObject* object );
66 
67  QModelIndex parent( const QModelIndex &index ) const;
68 
69  int columnCount( const QModelIndex &parent = QModelIndex() ) const;
70 
71  Qt::ItemFlags flags ( const QModelIndex & index ) const;
72 
73  bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
74 
75  void reset() { beginResetModel(); endResetModel(); }
76 
77  QItemSelectionModel *selectionModel();
78 
79 public Q_SLOTS:
80 
86  void setRootDocument( GeoDataDocument *document );
87  GeoDataDocument* rootDocument();
88 
89  int addFeature( GeoDataContainer *parent, GeoDataFeature *feature, int row = -1 );
90 
91  bool removeFeature( GeoDataContainer *parent, int index );
92 
93  int removeFeature( const GeoDataFeature *feature );
94 
95  void updateFeature( GeoDataFeature *feature );
96 
97  int addDocument( GeoDataDocument *document );
98 
99  void removeDocument( int index );
100 
101  void removeDocument( GeoDataDocument* document );
102 
103  void update();
104 
105 Q_SIGNALS:
108  void removed( GeoDataObject *object );
109  void added( GeoDataObject *object );
110  private:
111  Q_DISABLE_COPY( GeoDataTreeModel )
112  class Private;
113  Private* const d;
114 };
115 
116 }
117 
118 #endif // MARBLE_GEODATATREEMODEL_H
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::GeoDataTreeModel
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataContainer
A base class that can hold GeoDataFeatures.
Definition: GeoDataContainer.h:47
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractItemModel
marble_export.h
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:55
Marble::GeoDataTreeModel::reset
void reset()
Definition: GeoDataTreeModel.h:75
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