• 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
  • plugins
  • declarative
RouteRequestModel.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 2011 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #ifndef MARBLE_ROUTEREQUESTMODEL_H
12 #define MARBLE_ROUTEREQUESTMODEL_H
13 
14 #include <QAbstractListModel>
15 
16 namespace Marble { class RouteRequest; }
17 class Routing;
18 
19 class RouteRequestModel : public QAbstractListModel
20 {
21  Q_OBJECT
22 
23  Q_PROPERTY( Routing* routing READ routing WRITE setRouting NOTIFY routingChanged )
24  Q_PROPERTY( int count READ rowCount )
25 
26 public:
27  enum RouteRequestModelRoles {
28  LongitudeRole = Qt::UserRole+1,
29  LatitudeRole = Qt::UserRole+2
30  };
31 
33  explicit RouteRequestModel( QObject *parent = 0 );
34 
36  ~RouteRequestModel();
37 
38  // Model querying
39 
41  int rowCount ( const QModelIndex &parent = QModelIndex() ) const;
42 
43 #if QT_VERSION >= 0x050000
44 
45  QHash<int, QByteArray> roleNames() const;
46 #endif
47 
49  QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
50 
52  QVariant data ( const QModelIndex &index, int role = Qt::DisplayRole ) const;
53 
54  Routing *routing();
55 
56 public Q_SLOTS:
57  void setRouting( Routing *routing );
58 
59  void setPosition ( int index, qreal longitude, qreal latitude );
60 
61 Q_SIGNALS:
62  void routingChanged();
63 
64 private Q_SLOTS:
65  void updateMap();
66 
67  void updateData( int index );
68 
69  void updateAfterRemoval( int index );
70 
71  void updateAfterAddition( int index );
72 
73 private:
74  Marble::RouteRequest* m_request;
75  Routing *m_routing;
76 #if QT_VERSION >= 0x050000
77  QHash<int, QByteArray> m_roleNames;
78 #endif
79 };
80 
81 #endif // MARBLE_ROUTEREQUESTMODEL_H
RouteRequestModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Overload of QAbstractListModel.
Definition: RouteRequestModel.cpp:39
RouteRequestModel::setRouting
void setRouting(Routing *routing)
Definition: RouteRequestModel.cpp:82
RouteRequestModel::count
int count
Definition: RouteRequestModel.h:24
QObject
RouteRequestModel::RouteRequestModelRoles
RouteRequestModelRoles
Definition: RouteRequestModel.h:27
Routing
Definition: Routing.qml:15
RouteRequestModel
Definition: RouteRequestModel.h:19
RouteRequestModel::LongitudeRole
Definition: RouteRequestModel.h:28
Marble::RouteRequest
Points to be included in a route.
Definition: RouteRequest.h:31
RouteRequestModel::~RouteRequestModel
~RouteRequestModel()
Destructor.
Definition: RouteRequestModel.cpp:34
RouteRequestModel::routingChanged
void routingChanged()
RouteRequestModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Overload of QAbstractListModel.
Definition: RouteRequestModel.cpp:55
RouteRequestModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Overload of QAbstractListModel.
Definition: RouteRequestModel.cpp:64
RouteRequestModel::RouteRequestModel
RouteRequestModel(QObject *parent=0)
Constructor.
Definition: RouteRequestModel.cpp:19
RouteRequestModel::setPosition
void setPosition(int index, qreal longitude, qreal latitude)
Definition: RouteRequestModel.cpp:128
RouteRequestModel::LatitudeRole
Definition: RouteRequestModel.h:29
RouteRequestModel::routing
Routing * routing()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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