diff options
author | juhvu <qt-info@nokia.com> | 2011-08-24 14:55:51 +1000 |
---|---|---|
committer | David Laing <david.laing@nokia.com> | 2011-08-24 07:41:25 +0200 |
commit | ccaf530d04860a7a11ff57b1113c6d819df5b4dd (patch) | |
tree | 8aa3f2a272c6a3e92c851782fc274ccddc817ffc /src/imports/location/qdeclarativegeocodemodel_p.h | |
parent | b8e49782715d73bcdee1374073d938898a4c3cde (diff) | |
download | qtlocation-ccaf530d04860a7a11ff57b1113c6d819df5b4dd.tar.gz |
First pass on QML geocoding docs (no examples).
Change-Id: I156054bfd9296d180559c61de61baccba3cf33aa
Reviewed-on: http://codereview.qt.nokia.com/3442
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: David Laing <david.laing@nokia.com>
Diffstat (limited to 'src/imports/location/qdeclarativegeocodemodel_p.h')
-rw-r--r-- | src/imports/location/qdeclarativegeocodemodel_p.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/imports/location/qdeclarativegeocodemodel_p.h b/src/imports/location/qdeclarativegeocodemodel_p.h index 5071fa3c..c8d2b7ea 100644 --- a/src/imports/location/qdeclarativegeocodemodel_p.h +++ b/src/imports/location/qdeclarativegeocodemodel_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -63,16 +63,18 @@ class QDeclarativeGeocodeModel : public QAbstractListModel, public QDeclarativeP { Q_OBJECT Q_ENUMS(Status) + Q_ENUMS(GeocodeError) Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged) Q_PROPERTY(bool autoUpdate READ autoUpdate WRITE setAutoUpdate NOTIFY autoUpdateChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(QString error READ error NOTIFY errorChanged) + Q_PROPERTY(QString errorString READ errorString NOTIFY errorStringChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged) Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(QVariant query READ query WRITE setQuery NOTIFY queryChanged) Q_PROPERTY(QObject* bounds READ bounds WRITE setBounds NOTIFY boundsChanged) + Q_PROPERTY(GeocodeError error READ error NOTIFY errorChanged) Q_INTERFACES(QDeclarativeParserStatus) public: @@ -83,6 +85,16 @@ public: Error }; + enum GeocodeError { + NoError = QGeocodeReply::NoError, + EngineNotSetError = QGeocodeReply::EngineNotSetError, + CommunicationError = QGeocodeReply::CommunicationError, + ParseError = QGeocodeReply::ParseError, + UnsupportedOptionError = QGeocodeReply::UnsupportedOptionError, + CombinationError = QGeocodeReply::CombinationError, + UnknownError = QGeocodeReply::UnknownError + }; + enum Roles { LocationRole = Qt::UserRole + 1 }; @@ -105,7 +117,8 @@ public: QObject* bounds() const; Status status() const; - QString error() const; + QString errorString() const; + GeocodeError error() const; bool autoUpdate() const; void setAutoUpdate(bool update); @@ -127,6 +140,7 @@ Q_SIGNALS: void countChanged(); void pluginChanged(); void statusChanged(); + void errorStringChanged(); void errorChanged(); void locationsChanged(); void autoUpdateChanged(); @@ -148,7 +162,8 @@ protected Q_SLOTS: protected: QGeocodingManager* searchManager(); void setStatus(Status status); - void setError(const QString &error); + void setErrorString(const QString &error); + void setError(GeocodeError error); bool autoUpdate_; bool complete_; @@ -166,7 +181,8 @@ private: QList<QDeclarativeGeoLocation*> declarativeLocations_; Status status_; - QString error_; + QString errorString_; + GeocodeError error_; QVariant queryVariant_; QDeclarativeCoordinate* coordinate_; QDeclarativeGeoAddress* address_; |