libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::LocationInfoModel Class Reference

#include <LocationInfoModel.h>

+ Inheritance diagram for osmscout::LocationInfoModel:

Public Types

enum  Roles {
  LabelRole = Qt::UserRole, RegionRole = Qt::UserRole+1, AddressRole = Qt::UserRole+2, InPlaceRole = Qt::UserRole+3,
  DistanceRole = Qt::UserRole+4, BearingRole = Qt::UserRole+5, PoiRole = Qt::UserRole+6, TypeRole = Qt::UserRole+7,
  PostalCodeRole = Qt::UserRole+8, WebsiteRole = Qt::UserRole+9, PhoneRole = Qt::UserRole+10, AddressLocationRole = Qt::UserRole+11,
  AddressNumberRole = Qt::UserRole+12, IndexedAdminRegionRole = Qt::UserRole+13, AltLangName = Qt::UserRole+14, OpeningHours = Qt::UserRole+15
}
 

Public Slots

void dbInitialized (const osmscout::GeoBox &)
 
void onLocationAdminRegionFinished (const osmscout::GeoCoord)
 
void onLocationAdminRegions (const osmscout::GeoCoord, QList< AdminRegionInfoRef >)
 
void onLocationDescription (const osmscout::GeoCoord location, const QString database, const osmscout::LocationDescription description, const QList< AdminRegionInfoRef > regions)
 
void onLocationDescriptionFinished (const osmscout::GeoCoord)
 
void setLocation (const double lat, const double lon)
 

Signals

void locationDescriptionRequested (const osmscout::GeoCoord location)
 
void readyChange (bool ready)
 
void regionLookupRequested (osmscout::GeoCoord)
 

Public Member Functions

Q_INVOKABLE QString bearing (double lat1, double lon1, double lat2, double lon2)
 
Q_INVOKABLE QVariant data (const QModelIndex &index, int role) const override
 
Q_INVOKABLE double distance (double lat1, double lon1, double lat2, double lon2)
 
Q_INVOKABLE Qt::ItemFlags flags (const QModelIndex &index) const override
 
bool isReady () const
 
 LocationInfoModel ()
 
QHash< int, QByteArray > roleNames () const override
 
Q_INVOKABLE int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
 ~LocationInfoModel () override
 

Static Public Member Functions

static bool adminRegionComparator (const AdminRegionInfoRef &reg1, const AdminRegionInfoRef &reg2)
 
static bool distanceComparator (const QMap< int, QVariant > &obj1, const QMap< int, QVariant > &obj2)
 

Properties

bool ready
 

Member Enumeration Documentation

◆ Roles

Enumerator
LabelRole 
RegionRole 
AddressRole 
InPlaceRole 
DistanceRole 
BearingRole 
PoiRole 
TypeRole 
PostalCodeRole 
WebsiteRole 
PhoneRole 
AddressLocationRole 
AddressNumberRole 
IndexedAdminRegionRole 
AltLangName 
OpeningHours 

Constructor & Destructor Documentation

◆ LocationInfoModel()

◆ ~LocationInfoModel()

osmscout::LocationInfoModel::~LocationInfoModel ( )
override

Member Function Documentation

◆ adminRegionComparator()

bool osmscout::LocationInfoModel::adminRegionComparator ( const AdminRegionInfoRef &  reg1,
const AdminRegionInfoRef &  reg2 
)
static

Referenced by onLocationAdminRegions().

◆ bearing()

QString osmscout::LocationInfoModel::bearing ( double  lat1,
double  lon1,
double  lat2,
double  lon2 
)

◆ data()

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

◆ dbInitialized

void osmscout::LocationInfoModel::dbInitialized ( const osmscout::GeoBox )
slot

◆ distance()

double osmscout::LocationInfoModel::distance ( double  lat1,
double  lon1,
double  lat2,
double  lon2 
)

◆ distanceComparator()

bool osmscout::LocationInfoModel::distanceComparator ( const QMap< int, QVariant > &  obj1,
const QMap< int, QVariant > &  obj2 
)
static

References DistanceRole.

Referenced by onLocationAdminRegions().

◆ flags()

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

◆ isReady()

bool osmscout::LocationInfoModel::isReady ( ) const
inline

◆ locationDescriptionRequested

void osmscout::LocationInfoModel::locationDescriptionRequested ( const osmscout::GeoCoord  location)
signal

◆ onLocationAdminRegionFinished

void osmscout::LocationInfoModel::onLocationAdminRegionFinished ( const osmscout::GeoCoord  )
slot

References ready, and readyChange().

Referenced by LocationInfoModel().

◆ onLocationAdminRegions

◆ onLocationDescription

void osmscout::LocationInfoModel::onLocationDescription ( const osmscout::GeoCoord  location,
const QString  database,
const osmscout::LocationDescription  description,
const QList< AdminRegionInfoRef >  regions 
)
slot

◆ onLocationDescriptionFinished

void osmscout::LocationInfoModel::onLocationDescriptionFinished ( const osmscout::GeoCoord  location)
slot

◆ readyChange

void osmscout::LocationInfoModel::readyChange ( bool  ready)
signal

◆ regionLookupRequested

void osmscout::LocationInfoModel::regionLookupRequested ( osmscout::GeoCoord  )
signal

◆ roleNames()

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

◆ rowCount()

Q_INVOKABLE int osmscout::LocationInfoModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
inlineoverride

◆ setLocation

void osmscout::LocationInfoModel::setLocation ( const double  lat,
const double  lon 
)
slot

Property Documentation

◆ ready

bool osmscout::LocationInfoModel::ready
read

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