libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::MapDownloadsModel Class Reference

QML list model with currently downloaded maps. More...

#include <MapDownloadsModel.h>

Inheritance diagram for osmscout::MapDownloadsModel:

Public Types

enum  Roles {
  MapNameRole = Qt::UserRole , TargetDirectoryRole = Qt::UserRole+1 , ProgressRole = Qt::UserRole+2 , ProgressDescriptionRole = Qt::UserRole+3 ,
  ErrorStringRole = Qt::UserRole+4
}

Public Slots

void onDownloadJobsChanged ()
void onDownloadProgress ()

Signals

void mapDownloadFails (QString message)

Public Member Functions

Q_INVOKABLE void cancel (int row)
Q_INVOKABLE QVariant data (const QModelIndex &index, int role) const override
Q_INVOKABLE void downloadMap (QObject *map, QString dir)
Q_INVOKABLE Qt::ItemFlags flags (const QModelIndex &index) const override
Q_INVOKABLE double getFreeSpace (QString dir)
Q_INVOKABLE QStringList getLookupDirectories ()
 MapDownloadsModel (QObject *parent=Q_NULLPTR)
QHash< int, QByteArray > roleNames () const override
Q_INVOKABLE int rowCount (const QModelIndex &parent=QModelIndex()) const override
Q_INVOKABLE QString suggestedDirectory (QObject *map, QString rootDirectory="")
 ~MapDownloadsModel () override=default

Detailed Description

QML list model with currently downloaded maps.

It provide methods (invocable from QML) for starting new map download.

Member Enumeration Documentation

◆ Roles

Enumerator
MapNameRole 
TargetDirectoryRole 
ProgressRole 
ProgressDescriptionRole 
ErrorStringRole 

Constructor & Destructor Documentation

◆ MapDownloadsModel()

◆ ~MapDownloadsModel()

osmscout::MapDownloadsModel::~MapDownloadsModel ( )
overridedefault

Member Function Documentation

◆ cancel()

void osmscout::MapDownloadsModel::cancel ( int row)

◆ data()

QVariant osmscout::MapDownloadsModel::data ( const QModelIndex & index,
int role ) const
override

◆ downloadMap()

void osmscout::MapDownloadsModel::downloadMap ( QObject * map,
QString dir )

◆ flags()

Qt::ItemFlags osmscout::MapDownloadsModel::flags ( const QModelIndex & index) const
override

◆ getFreeSpace()

double osmscout::MapDownloadsModel::getFreeSpace ( QString dir)

◆ getLookupDirectories()

QStringList osmscout::MapDownloadsModel::getLookupDirectories ( )

◆ mapDownloadFails

void osmscout::MapDownloadsModel::mapDownloadFails ( QString message)
signal

◆ onDownloadJobsChanged

void osmscout::MapDownloadsModel::onDownloadJobsChanged ( )
slot

◆ onDownloadProgress

void osmscout::MapDownloadsModel::onDownloadProgress ( )
slot

◆ roleNames()

QHash< int, QByteArray > osmscout::MapDownloadsModel::roleNames ( ) const
override

◆ rowCount()

int osmscout::MapDownloadsModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

◆ suggestedDirectory()

QString osmscout::MapDownloadsModel::suggestedDirectory ( QObject * map,
QString rootDirectory = "" )

The documentation for this class was generated from the following files: