diff --git a/python/core/qgsmaplayer.sip b/python/core/qgsmaplayer.sip index 20a0a167fba..3c706020b13 100644 --- a/python/core/qgsmaplayer.sip +++ b/python/core/qgsmaplayer.sip @@ -462,8 +462,10 @@ class QgsMapLayer : QObject * @param node node that will contain the style definition for this layer. * @param errorMessage reference to string that will be updated with any error messages * @return true in case of success. + * @note added in 2.16 + * @note To be implemented in subclasses. Default implementation does nothing and returns false. */ - virtual bool readStyle( const QDomNode& node, QString& errorMessage ) = 0; + virtual bool readStyle( const QDomNode& node, QString& errorMessage ); /** Write the symbology for the layer into the docment provided. * @param node the node that will have the style element added to it. @@ -478,13 +480,17 @@ class QgsMapLayer : QObject * @param doc the document that will have the QDomNode added. * @param errorMessage reference to string that will be updated with any error messages * @return true in case of success. + * @note added in 2.16 + * @note To be implemented in subclasses. Default implementation does nothing and returns false. */ - virtual bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const = 0; + virtual bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const; /** Return pointer to layer's undo stack */ QUndoStack *undoStack(); - /** Return pointer to layer's style undo stack */ + /** Return pointer to layer's style undo stack + * @note added in 2.16 + */ QUndoStack *undoStackStyles(); /* Layer legendUrl information */ diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index be922f0444a..801d3f52db3 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -1609,6 +1609,21 @@ QString QgsMapLayer::loadSldStyle( const QString &theURI, bool &theResultFlag ) return ""; } +bool QgsMapLayer::readStyle( const QDomNode& node, QString& errorMessage ) +{ + Q_UNUSED( node ); + Q_UNUSED( errorMessage ); + return false; +} + +bool QgsMapLayer::writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const +{ + Q_UNUSED( node ); + Q_UNUSED( doc ); + Q_UNUSED( errorMessage ); + return false; +} + QUndoStack* QgsMapLayer::undoStack() { diff --git a/src/core/qgsmaplayer.h b/src/core/qgsmaplayer.h index 53b7117163c..a694e08cfe3 100644 --- a/src/core/qgsmaplayer.h +++ b/src/core/qgsmaplayer.h @@ -482,8 +482,10 @@ class CORE_EXPORT QgsMapLayer : public QObject * @param node node that will contain the style definition for this layer. * @param errorMessage reference to string that will be updated with any error messages * @return true in case of success. + * @note added in 2.16 + * @note To be implemented in subclasses. Default implementation does nothing and returns false. */ - virtual bool readStyle( const QDomNode& node, QString& errorMessage ) = 0; + virtual bool readStyle( const QDomNode& node, QString& errorMessage ); /** Write the symbology for the layer into the docment provided. * @param node the node that will have the style element added to it. @@ -498,13 +500,17 @@ class CORE_EXPORT QgsMapLayer : public QObject * @param doc the document that will have the QDomNode added. * @param errorMessage reference to string that will be updated with any error messages * @return true in case of success. + * @note added in 2.16 + * @note To be implemented in subclasses. Default implementation does nothing and returns false. */ - virtual bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const = 0; + virtual bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const; /** Return pointer to layer's undo stack */ QUndoStack *undoStack(); - /** Return pointer to layer's style undo stack */ + /** Return pointer to layer's style undo stack + * @note added in 2.16 + */ QUndoStack *undoStackStyles(); /* Layer legendUrl information */