From 21eab8c2eab79f839d2ae8cf47339d05747300b7 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 15 Jul 2016 08:08:24 +1000 Subject: [PATCH] Add missing docs --- python/core/qgsmaplayer.sip | 21 +++++++++++++++++++++ python/core/qgsvectorlayer.sip | 6 ++++++ src/core/qgsmaplayer.h | 21 +++++++++++++++++++++ src/core/qgsvectorlayer.h | 6 ++++++ src/core/qgsvectorlayerfeatureiterator.h | 5 +++++ 5 files changed, 59 insertions(+) diff --git a/python/core/qgsmaplayer.sip b/python/core/qgsmaplayer.sip index 85c3d86d573..7a7299df6b8 100644 --- a/python/core/qgsmaplayer.sip +++ b/python/core/qgsmaplayer.sip @@ -447,6 +447,12 @@ class QgsMapLayer : QObject */ virtual QString loadNamedStyle( const QString& uri, bool &resultFlag /Out/ ); + /** Retrieve a named style for this layer from a sqlite database. + * @param db path to sqlite database + * @param uri uri for table + * @param qml will be set to QML style content from database + * @returns true if style was successfully loaded + */ virtual bool loadNamedStyleFromDb( const QString &db, const QString &uri, QString &qml /Out/ ); /** @@ -500,7 +506,22 @@ class QgsMapLayer : QObject */ virtual QString saveNamedStyle( const QString &uri, bool &resultFlag /Out/ ); + /** Saves the properties of this layer to an SLD format file. + * @param uri uri of destination for exported SLD file. + * @param resultFlag a reference to a flag that will be set to false if + * the SLD file could not be generated + * @returns a string with any status or error messages + * @see loadSldStyle() + */ virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const; + + /** Attempts to style the layer using the formatting from an SLD type file. + * @param uri uri of source SLD file + * @param resultFlag a reference to a flag that will be set to false if + * the SLD file could not be loaded + * @returns a string with any status or error messages + * @see saveSldStyle() + */ virtual QString loadSldStyle( const QString &uri, bool &resultFlag ); virtual bool readSld( const QDomNode &node, QString &errorMessage ); diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip index 6f5b7f0bb52..75f6b0d4ccf 100644 --- a/python/core/qgsvectorlayer.sip +++ b/python/core/qgsvectorlayer.sip @@ -1083,8 +1083,14 @@ class QgsVectorLayer : QgsMapLayer * so if a stage fails, it's difficult to roll back cleanly. * Therefore any error message also includes which stage failed so * that the user has some chance of repairing the damage cleanly. + * @see commitErrors() */ bool commitChanges(); + + /** Returns a list containing any error messages generated when attempting + * to commit changes to the layer. + * @see commitChanges() + */ QStringList commitErrors() const; /** Stop editing and discard the edits diff --git a/src/core/qgsmaplayer.h b/src/core/qgsmaplayer.h index 9f5dbcf9e17..e93b7b23a32 100644 --- a/src/core/qgsmaplayer.h +++ b/src/core/qgsmaplayer.h @@ -466,6 +466,12 @@ class CORE_EXPORT QgsMapLayer : public QObject */ virtual QString loadNamedStyle( const QString& uri, bool &resultFlag ); + /** Retrieve a named style for this layer from a sqlite database. + * @param db path to sqlite database + * @param uri uri for table + * @param qml will be set to QML style content from database + * @returns true if style was successfully loaded + */ virtual bool loadNamedStyleFromDb( const QString &db, const QString &uri, QString &qml ); /** @@ -520,7 +526,22 @@ class CORE_EXPORT QgsMapLayer : public QObject */ virtual QString saveNamedStyle( const QString &uri, bool &resultFlag ); + /** Saves the properties of this layer to an SLD format file. + * @param uri uri of destination for exported SLD file. + * @param resultFlag a reference to a flag that will be set to false if + * the SLD file could not be generated + * @returns a string with any status or error messages + * @see loadSldStyle() + */ virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const; + + /** Attempts to style the layer using the formatting from an SLD type file. + * @param uri uri of source SLD file + * @param resultFlag a reference to a flag that will be set to false if + * the SLD file could not be loaded + * @returns a string with any status or error messages + * @see saveSldStyle() + */ virtual QString loadSldStyle( const QString &uri, bool &resultFlag ); virtual bool readSld( const QDomNode &node, QString &errorMessage ) diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h index 9ac870f4839..f5d6543bee5 100644 --- a/src/core/qgsvectorlayer.h +++ b/src/core/qgsvectorlayer.h @@ -1472,8 +1472,14 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer * so if a stage fails, it's difficult to roll back cleanly. * Therefore any error message also includes which stage failed so * that the user has some chance of repairing the damage cleanly. + * @see commitErrors() */ bool commitChanges(); + + /** Returns a list containing any error messages generated when attempting + * to commit changes to the layer. + * @see commitChanges() + */ QStringList commitErrors() const; /** Stop editing and discard the edits diff --git a/src/core/qgsvectorlayerfeatureiterator.h b/src/core/qgsvectorlayerfeatureiterator.h index b76d9298daa..44a48a24b90 100644 --- a/src/core/qgsvectorlayerfeatureiterator.h +++ b/src/core/qgsvectorlayerfeatureiterator.h @@ -37,7 +37,12 @@ class QgsVectorLayerFeatureIterator; class QgsVectorLayerFeatureSource : public QgsAbstractFeatureSource { public: + + /** Constructor for QgsVectorLayerFeatureSource. + * @param layer source layer + */ explicit QgsVectorLayerFeatureSource( const QgsVectorLayer* layer ); + ~QgsVectorLayerFeatureSource(); virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request ) override;