mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Fix API break of QgsMapLayer class introduced in 2.16
This breakage was resulting in a Python error when using plugin layers due to calls to pure virtual method writeStyle()
This commit is contained in:
parent
b040410c5e
commit
8fcac87f9d
@ -462,8 +462,10 @@ class QgsMapLayer : QObject
|
|||||||
* @param node node that will contain the style definition for this layer.
|
* @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
|
* @param errorMessage reference to string that will be updated with any error messages
|
||||||
* @return true in case of success.
|
* @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.
|
/** Write the symbology for the layer into the docment provided.
|
||||||
* @param node the node that will have the style element added to it.
|
* @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 doc the document that will have the QDomNode added.
|
||||||
* @param errorMessage reference to string that will be updated with any error messages
|
* @param errorMessage reference to string that will be updated with any error messages
|
||||||
* @return true in case of success.
|
* @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 */
|
/** Return pointer to layer's undo stack */
|
||||||
QUndoStack *undoStack();
|
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();
|
QUndoStack *undoStackStyles();
|
||||||
|
|
||||||
/* Layer legendUrl information */
|
/* Layer legendUrl information */
|
||||||
|
@ -1609,6 +1609,21 @@ QString QgsMapLayer::loadSldStyle( const QString &theURI, bool &theResultFlag )
|
|||||||
return "";
|
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()
|
QUndoStack* QgsMapLayer::undoStack()
|
||||||
{
|
{
|
||||||
|
@ -482,8 +482,10 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
|||||||
* @param node node that will contain the style definition for this layer.
|
* @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
|
* @param errorMessage reference to string that will be updated with any error messages
|
||||||
* @return true in case of success.
|
* @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.
|
/** Write the symbology for the layer into the docment provided.
|
||||||
* @param node the node that will have the style element added to it.
|
* @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 doc the document that will have the QDomNode added.
|
||||||
* @param errorMessage reference to string that will be updated with any error messages
|
* @param errorMessage reference to string that will be updated with any error messages
|
||||||
* @return true in case of success.
|
* @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 */
|
/** Return pointer to layer's undo stack */
|
||||||
QUndoStack *undoStack();
|
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();
|
QUndoStack *undoStackStyles();
|
||||||
|
|
||||||
/* Layer legendUrl information */
|
/* Layer legendUrl information */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user