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

#include <libosmscout-client-qt/include/osmscoutclientqt/MapDownloadsModel.h>

Inheritance diagram for osmscout::MapDownloadsModel:
Collaboration 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

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

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()

osmscout::MapDownloadsModel::MapDownloadsModel ( QObject * parent = Q_NULLPTR)

◆ ~MapDownloadsModel()

osmscout::MapDownloadsModel::~MapDownloadsModel ( )
overridedefault

Member Function Documentation

◆ cancel()

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

◆ data()

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

◆ downloadMap()

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

◆ flags()

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

◆ getFreeSpace()

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

◆ getLookupDirectories()

Q_INVOKABLE 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()

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

◆ suggestedDirectory()

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

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