mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Remove const_cast
This commit is contained in:
parent
3de0593957
commit
ffc71c4f57
@ -240,7 +240,7 @@ with the variables specified.
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
static QgsExpressionContextScope *atlasScope( QgsLayoutAtlas *atlas ) /Factory/;
|
||||
static QgsExpressionContextScope *atlasScope( const QgsLayoutAtlas *atlas ) /Factory/;
|
||||
%Docstring
|
||||
Creates a new scope which contains variables and functions relating to a :py:class:`QgsLayoutAtlas`.
|
||||
For instance, current page name and number.
|
||||
|
@ -41,7 +41,7 @@ is available or required.
|
||||
Ends the render, performing any required cleanup tasks.
|
||||
%End
|
||||
|
||||
virtual int count() = 0;
|
||||
virtual int count() const = 0;
|
||||
%Docstring
|
||||
Returns the number of features to iterate over.
|
||||
%End
|
||||
|
@ -105,7 +105,7 @@ Returns the parent report section.
|
||||
Returns the associated project.
|
||||
%End
|
||||
|
||||
virtual int count();
|
||||
virtual int count() const;
|
||||
|
||||
virtual QString filePath( const QString &baseFilePath, const QString &extension );
|
||||
|
||||
|
@ -267,7 +267,7 @@ number of matching features.
|
||||
|
||||
virtual bool endRender();
|
||||
|
||||
virtual int count();
|
||||
virtual int count() const;
|
||||
|
||||
virtual QString filePath( const QString &baseFilePath, const QString &extension );
|
||||
|
||||
|
@ -514,7 +514,7 @@ void QgsExpressionContextUtils::setLayoutVariables( QgsLayout *layout, const QVa
|
||||
layout->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
|
||||
}
|
||||
|
||||
QgsExpressionContextScope *QgsExpressionContextUtils::atlasScope( QgsLayoutAtlas *atlas )
|
||||
QgsExpressionContextScope *QgsExpressionContextUtils::atlasScope( const QgsLayoutAtlas *atlas )
|
||||
{
|
||||
QgsExpressionContextScope *scope = new QgsExpressionContextScope( QObject::tr( "Atlas" ) );
|
||||
if ( !atlas )
|
||||
|
@ -222,7 +222,7 @@ class CORE_EXPORT QgsExpressionContextUtils
|
||||
* For instance, current page name and number.
|
||||
* \param atlas source atlas. If NULLPTR, a set of default atlas variables will be added to the scope.
|
||||
*/
|
||||
static QgsExpressionContextScope *atlasScope( QgsLayoutAtlas *atlas ) SIP_FACTORY;
|
||||
static QgsExpressionContextScope *atlasScope( const QgsLayoutAtlas *atlas ) SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Creates a new scope which contains variables and functions relating to a QgsLayoutItem.
|
||||
|
@ -54,7 +54,7 @@ class CORE_EXPORT QgsAbstractLayoutIterator
|
||||
/**
|
||||
* Returns the number of features to iterate over.
|
||||
*/
|
||||
virtual int count() = 0;
|
||||
virtual int count() const = 0;
|
||||
|
||||
/**
|
||||
* Iterates to next feature, returning FALSE if no more features exist to iterate over.
|
||||
|
@ -121,7 +121,7 @@ class CORE_EXPORT QgsAbstractReportSection : public QgsAbstractLayoutIterator
|
||||
QgsProject *project();
|
||||
|
||||
// TODO - how to handle this?
|
||||
int count() override { return -1; }
|
||||
int count() const override { return -1; }
|
||||
|
||||
QString filePath( const QString &baseFilePath, const QString &extension ) override;
|
||||
QgsLayout *layout() override;
|
||||
|
@ -340,7 +340,7 @@ bool QgsLayoutAtlas::endRender()
|
||||
return true;
|
||||
}
|
||||
|
||||
int QgsLayoutAtlas::count()
|
||||
int QgsLayoutAtlas::count() const
|
||||
{
|
||||
return mFeatureIds.size();
|
||||
}
|
||||
@ -447,7 +447,7 @@ QgsExpressionContext QgsLayoutAtlas::createExpressionContext() const
|
||||
expressionContext << QgsExpressionContextUtils::projectScope( mLayout->project() )
|
||||
<< QgsExpressionContextUtils::layoutScope( mLayout );
|
||||
|
||||
expressionContext.appendScope( QgsExpressionContextUtils::atlasScope( const_cast< QgsLayoutAtlas * >( this ) ) );
|
||||
expressionContext.appendScope( QgsExpressionContextUtils::atlasScope( this ) );
|
||||
|
||||
if ( mCoverageLayer )
|
||||
expressionContext.appendScope( mCoverageLayer->createExpressionContextScope() );
|
||||
|
@ -245,7 +245,7 @@ class CORE_EXPORT QgsLayoutAtlas : public QObject, public QgsAbstractLayoutItera
|
||||
|
||||
bool beginRender() override;
|
||||
bool endRender() override;
|
||||
int count() override;
|
||||
int count() const override;
|
||||
QString filePath( const QString &baseFilePath, const QString &extension ) override;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user