marble
#include <CloudRouteModel.h>
Inherits QAbstractListModel.
Public Types | |
| enum | RouteRoles { Timestamp = Qt::UserRole + 1, Name, PreviewUrl, Distance, Duration, IsCached, IsDownloading, IsOnCloud } |
Public Slots | |
| void | setPreview (QNetworkReply *reply) |
| void | updateProgress (qint64 currentSize, qint64 totalSize) |
Public Member Functions | |
| CloudRouteModel (QObject *parent=0) | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| qint64 | downloadedSize () const |
| QPersistentModelIndex | downloadingItem () const |
| bool | isCached (const QModelIndex &index) const |
| bool | isDownloading (const QModelIndex &index) const |
| QIcon | preview (const QModelIndex &index) const |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| void | setDownloadingItem (const QPersistentModelIndex &index) |
| void | setItems (const QVector< RouteItem > &items) |
| qint64 | totalSize () const |
Detailed Description
Definition at line 25 of file CloudRouteModel.h.
Member Enumeration Documentation
| Enumerator | |
|---|---|
| Timestamp | |
| Name | |
| PreviewUrl | |
| Distance | |
| Duration | |
| IsCached | |
| IsDownloading | |
| IsOnCloud | |
Definition at line 30 of file CloudRouteModel.h.
Constructor & Destructor Documentation
|
explicit |
Definition at line 52 of file CloudRouteModel.cpp.
Member Function Documentation
| QVariant Marble::CloudRouteModel::data | ( | const QModelIndex & | index, |
| int | role = Qt::DisplayRole |
||
| ) | const |
Definition at line 74 of file CloudRouteModel.cpp.
| qint64 Marble::CloudRouteModel::downloadedSize | ( | ) | const |
Returns how much of the route are downloaded as bytes.
- Returns
- Downloaded bytes
Definition at line 140 of file CloudRouteModel.cpp.
| QPersistentModelIndex Marble::CloudRouteModel::downloadingItem | ( | ) | const |
Getter for the item currently being downloaded.
- Returns
- Model for the item currently being downloaded
Definition at line 120 of file CloudRouteModel.cpp.
| bool Marble::CloudRouteModel::isCached | ( | const QModelIndex & | index | ) | const |
Checks if specified route exists in the local cache.
- Parameters
-
index Index of the route.
- Returns
- true, if exists.
Definition at line 114 of file CloudRouteModel.cpp.
| bool Marble::CloudRouteModel::isDownloading | ( | const QModelIndex & | index | ) | const |
Checks if route is being downloaded.
- Parameters
-
index Index of the route.
- Returns
- true, if downloading.
Definition at line 130 of file CloudRouteModel.cpp.
| QIcon Marble::CloudRouteModel::preview | ( | const QModelIndex & | index | ) | const |
Checks whether a preview for the route available and returns or downloads the preview.
- Parameters
-
index Index of the item whose preview is requested
- Returns
- Route's preview as QIcon
Definition at line 145 of file CloudRouteModel.cpp.
| int Marble::CloudRouteModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Definition at line 93 of file CloudRouteModel.cpp.
| void Marble::CloudRouteModel::setDownloadingItem | ( | const QPersistentModelIndex & | index | ) |
Marks the route at given index as being downloaded.
- Parameters
-
index Index of the route.
Definition at line 125 of file CloudRouteModel.cpp.
| void Marble::CloudRouteModel::setItems | ( | const QVector< RouteItem > & | items | ) |
Sets the list of routes that will show up in CloudRoutesDialog.
- Parameters
-
items List of routes.
Definition at line 105 of file CloudRouteModel.cpp.
|
slot |
Definition at line 159 of file CloudRouteModel.cpp.
| qint64 Marble::CloudRouteModel::totalSize | ( | ) | const |
Total size of the item currently being downloaded.
- Returns
- Total size of the item, -1 if no route is being downloaded
Definition at line 135 of file CloudRouteModel.cpp.
|
slot |
Definition at line 173 of file CloudRouteModel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference