• 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
MarblePlacemarkModel.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 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 //
13 // MarblePlacemarkModel exposes the model for Placemarks
14 //
15 
16 #ifndef MARBLE_MARBLEPLACEMARKMODEL_H
17 #define MARBLE_MARBLEPLACEMARKMODEL_H
18 
19 
20 #include <QAbstractListModel>
21 #include <QModelIndex>
22 #include <QVariant>
23 
24 #include "marble_export.h"
25 
26 #include "GeoDataPlacemark.h"
27 
28 namespace Marble
29 {
30 
31 class GeoDataCoordinates;
32 class GeoDataStyle;
37 class MARBLE_EXPORT MarblePlacemarkModel : public QAbstractListModel
38 {
39  friend class PlacemarkManager;
40 
41  Q_OBJECT
42 
43  Q_PROPERTY( int count READ rowCount NOTIFY countChanged )
44 
45  public:
49  enum Roles
50  {
51  GeoTypeRole = Qt::UserRole + 1,
52  DescriptionRole,
53  CoordinateRole,
54  PopulationRole,
55  AreaRole,
56  CountryCodeRole,
57  StateRole,
58  VisualCategoryRole,
59  StyleRole,
60  PopularityIndexRole,
61  PopularityRole,
62  ObjectPointerRole,
63  GmtRole,
64  DstRole,
65  GeometryRole,
66  LongitudeRole,
67  LatitudeRole
68  };
69 
75  explicit MarblePlacemarkModel( QObject *parent = 0 );
76 
80  ~MarblePlacemarkModel();
81 
82  void setPlacemarkContainer( QVector<GeoDataPlacemark*> *container );
83 
87  int rowCount( const QModelIndex &parent = QModelIndex() ) const;
88  int columnCount( const QModelIndex &parent = QModelIndex() ) const;
89 
90 #if QT_VERSION >= 0x050000
91 
94  QHash<int, QByteArray> roleNames() const;
95 #endif
96 
103  QVariant data( const QModelIndex &index, int role ) const;
104 
105  QModelIndexList approxMatch( const QModelIndex &start, int role,
106  const QVariant &value, int hits = 1,
107  Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const;
108 
113  void addPlacemarks( int start,
114  int length );
115 
120  void removePlacemarks( const QString &containerName,
121  int start,
122  int length );
123 
124 Q_SIGNALS:
125  void countChanged();
126 
127  private:
128 
129  Q_DISABLE_COPY( MarblePlacemarkModel )
130  class Private;
131  Private* const d;
132 #if QT_VERSION >= 0x050000
133  QHash<int, QByteArray> m_roleNames;
134 #endif
135 };
136 
137 }
138 
139 #endif
QModelIndex
Marble::MarblePlacemarkModel
This class represents a model of all place marks which are currently available through a given Placem...
Definition: MarblePlacemarkModel.h:37
Marble::MarblePlacemarkModel::GeometryRole
The GeoDataGeometry geometry.
Definition: MarblePlacemarkModel.h:65
Marble::MarblePlacemarkModel::StyleRole
The style.
Definition: MarblePlacemarkModel.h:59
Qt::MatchFlags
typedef MatchFlags
Marble::MarblePlacemarkModel::ObjectPointerRole
The pointer to a specific object.
Definition: MarblePlacemarkModel.h:62
Marble::MarblePlacemarkModel::VisualCategoryRole
The category.
Definition: MarblePlacemarkModel.h:58
Marble::MarblePlacemarkModel::DescriptionRole
The description.
Definition: MarblePlacemarkModel.h:52
Marble::MarblePlacemarkModel::PopulationRole
The population.
Definition: MarblePlacemarkModel.h:54
QHash
QObject
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QAbstractListModel
Marble::MarblePlacemarkModel::GmtRole
The Greenwich Mean Time.
Definition: MarblePlacemarkModel.h:63
QString
Marble::MarblePlacemarkModel::Roles
Roles
The roles of the place marks.
Definition: MarblePlacemarkModel.h:49
Marble::MarblePlacemarkModel::PopularityRole
The popularity.
Definition: MarblePlacemarkModel.h:61
GeoDataPlacemark.h
Marble::MarblePlacemarkModel::PopularityIndexRole
The popularity index.
Definition: MarblePlacemarkModel.h:60
Marble::MarblePlacemarkModel::DstRole
The Daylight Saving Time.
Definition: MarblePlacemarkModel.h:64
Marble::MarblePlacemarkModel::CoordinateRole
The GeoDataCoordinates coordinate.
Definition: MarblePlacemarkModel.h:53
Marble::MarblePlacemarkModel::CountryCodeRole
The country code.
Definition: MarblePlacemarkModel.h:56
QVector
marble_export.h
Marble::MarblePlacemarkModel::StateRole
The state.
Definition: MarblePlacemarkModel.h:57
Marble::MarblePlacemarkModel::AreaRole
The area size.
Definition: MarblePlacemarkModel.h:55
Marble::MarblePlacemarkModel::LongitudeRole
The longitude in degree (for use in QML)
Definition: MarblePlacemarkModel.h:66
QVariant
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