Skip to content
Permalink
Browse files

back to const methods

  • Loading branch information
luipir committed Feb 12, 2019
1 parent 6af1d3f commit ee18eb565486219f824a305da19241084939f560
@@ -819,7 +819,7 @@ Export the properties of this layer as named style in a QDomDocument
%End


virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;
%Docstring
Export the properties of this layer as SLD style in a QDomDocument

@@ -862,7 +862,7 @@ record in the users style table in their personal qgis.db)
.. seealso:: :py:func:`saveDefaultStyle`
%End

virtual QString saveSldStyle( const QString &uri, bool &resultFlag );
virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;
%Docstring
Saves the properties of this layer to an SLD format file.

@@ -344,7 +344,7 @@ Draws a preview of the rasterlayer into a QImage
virtual QDateTime timestamp() const;


bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() );
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
%Docstring
Writes the symbology of the layer into the document provided in SLD 1.0.0 format

@@ -1391,15 +1391,15 @@ QString QgsMapLayer::saveNamedStyle( const QString &uri, bool &resultFlag, Style
return saveNamedProperty( uri, QgsMapLayer::Style, resultFlag, categories );
}

void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg )
void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg ) const
{
QDomDocument myDocument = QDomDocument();

QDomNode header = myDocument.createProcessingInstruction( QStringLiteral( "xml" ), QStringLiteral( "version=\"1.0\" encoding=\"UTF-8\"" ) );
myDocument.appendChild( header );

const QgsVectorLayer *vlayer = qobject_cast<const QgsVectorLayer *>( this );
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( this );
const QgsRasterLayer *rlayer = qobject_cast<const QgsRasterLayer *>( this );
if ( !vlayer && !rlayer )
{
errorMsg = tr( "Could not save symbology because:\n%1" )
@@ -1468,7 +1468,7 @@ void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg )
doc = myDocument;
}

QString QgsMapLayer::saveSldStyle( const QString &uri, bool &resultFlag )
QString QgsMapLayer::saveSldStyle( const QString &uri, bool &resultFlag ) const
{
QString errorMsg;
QDomDocument myDocument;
@@ -779,7 +779,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
* \param errorMsg this QString will be initialized on error
* during the execution of writeSymbology
*/
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg );
virtual void exportSldStyle( QDomDocument &doc, QString &errorMsg ) const;

/**
* Save the properties of this layer as the default style
@@ -817,7 +817,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
* \returns a string with any status or error messages
* \see loadSldStyle()
*/
virtual QString saveSldStyle( const QString &uri, bool &resultFlag );
virtual QString saveSldStyle( const QString &uri, bool &resultFlag ) const;

/**
* Attempts to style the layer using the formatting from an SLD type file.
@@ -1220,7 +1220,7 @@ QDateTime QgsRasterLayer::timestamp() const
}


bool QgsRasterLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props )
bool QgsRasterLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props ) const
{
Q_UNUSED( errorMessage );

@@ -409,7 +409,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
* \returns true in case of success
* \since QGIS 3.6
*/
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() );
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;


public slots:

0 comments on commit ee18eb5

Please sign in to comment.
You can’t perform that action at this time.