|
libosmscout 1.1.1
|
#include <libosmscout-client-qt/include/osmscoutclientqt/SearchLocationModel.h>


Public Types | |
| enum | Roles { LabelRole = Qt::UserRole , TypeRole = Qt::UserRole +1 , RegionRole = Qt::UserRole +2 , LatRole = Qt::UserRole +3 , LonRole = Qt::UserRole +4 , DistanceRole = Qt::UserRole +5 , BearingRole = Qt::UserRole +6 , LocationObjectRole = Qt::UserRole +7 , IndexedAdminRegionRole = Qt::UserRole +8 , AltLangName = Qt::UserRole +9 } |
Public Slots | |
| void | setPattern (const QString &pattern) |
| void | onSearchResult (const QString searchPattern, const QList< LocationEntry >) |
| void | onSearchFinished (const QString searchPattern, bool error) |
| void | onLocationAdminRegions (const osmscout::GeoCoord, QList< AdminRegionInfoRef >) |
| void | onLocationAdminRegionFinished (const osmscout::GeoCoord) |
Signals | |
| void | SearchRequested (const QString searchPattern, int limit, osmscout::GeoCoord searchCenter, AdminRegionInfoRef defaultRegion, osmscout::BreakerRef breaker) |
| void | SearchingChanged (bool) |
| void | countChanged (int) |
| void | regionLookupRequested (osmscout::GeoCoord) |
Public Member Functions | |
| LocationListModel (QObject *parent=nullptr) | |
| LocationListModel (const LocationListModel &)=delete | |
| LocationListModel (LocationListModel &&)=delete | |
| ~LocationListModel () override | |
| LocationListModel & | operator= (const LocationListModel &)=delete |
| LocationListModel & | operator= (LocationListModel &&)=delete |
| QJSValue | getCompare () const |
| void | setCompare (const QJSValue &fn) |
| QJSValue | getEquals () const |
| void | setEquals (const QJSValue &fn) |
| Q_INVOKABLE QVariant | data (const QModelIndex &index, int role) const override |
| Q_INVOKABLE int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Q_INVOKABLE Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QHash< int, QByteArray > | roleNames () const override |
| Q_INVOKABLE QObject * | get (int row) const |
| bool | isSearching () const |
| double | GetLat () const |
| double | GetLon () const |
| void | SetLat (double lat) |
| void | SetLon (double lon) |
| int | GetResultLimit () const |
| void | SetResultLimit (int limit) |
| int | GetDisplayLimit () const |
| void | SetDisplayLimit (int limit) |
| QString | getPattern () const |
Properties | |
| int | count |
| bool | searching =false |
| double | lat |
| double | lon |
| int | resultLimit =2000 |
| int | displayLimit =100 |
| QString | pattern |
| QJSValue | compare |
| QJSValue | equals |
Model for searching objects in osmscout databases by pattern written by human.
|
explicit |
|
delete |
|
delete |
|
override |
|
signal |
|
override |
|
override |
| Q_INVOKABLE QObject * osmscout::LocationListModel::get | ( | int | row | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
slot |
|
slot |
|
slot |
|
slot |
|
delete |
|
delete |
|
signal |
|
override |
|
override |
|
signal |
|
signal |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
slot |
|
inline |
|
readwrite |
JavaScript function used for sorting search results. Compare function will receive two locations arguments, A and B, where A < B (A should be shown before B), compare function should return number < 0.
For sorting results alphabetically:
|
read |
Count of rows in model - count of search results
|
readwrite |
Limit of model rows
|
readwrite |
JavaScript function used for check location equality. It is possible that model will returns one physical location multiple times, for example one from location index and second from fulltext search, or two db segments for one real street...
Such results may be merged in model. Function will receive two locations (only locations with same label will be checked) and should return boolean result.
For example, merge near objects with same label and type:
|
readwrite |
Lat and lon properties control where is logical search center. Local admin region is used as default region, databases used for search are sorted by distance from this point (local results should be available faster).
|
readwrite |
|
readwrite |
Searched pattern
|
readwrite |
Limit of results for each db.
|
read |
True if searching is in progress