mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-17 00:09:36 -04:00
remove expression functionality identified by name
This commit is contained in:
parent
7f93ac6e14
commit
d11f4e6b76
@ -42,6 +42,14 @@ Adds an expression to the list
|
||||
:param name: optional name of the expression
|
||||
:param expression: the expression content
|
||||
:param tag: some content, maybe scope where to be shown
|
||||
%End
|
||||
|
||||
void removeStoredExpression( const QString &name, const QString &tag = QString() );
|
||||
%Docstring
|
||||
Removes an expression to the list
|
||||
|
||||
:param name: name of the expression as identification
|
||||
:param tag: some content, maybe scope where to be shown
|
||||
%End
|
||||
|
||||
void addStoredExpressions( QList< QPair< QString, QString > > namedexpressions, const QString &tag = QString() );
|
||||
|
@ -34,6 +34,22 @@ void QgsStoredExpressionManager::addStoredExpression( const QString &name, const
|
||||
mStoredExpressions.append( storedExpression );
|
||||
}
|
||||
|
||||
void QgsStoredExpressionManager::removeStoredExpression( const QString &name, const QString &tag )
|
||||
{
|
||||
Q_UNUSED( tag );
|
||||
|
||||
int i = 0;
|
||||
for ( const QPair<QString, QString> &storedExpression : mStoredExpressions )
|
||||
{
|
||||
if ( storedExpression.first == name )
|
||||
{
|
||||
mStoredExpressions.removeAt( i );
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsStoredExpressionManager::addStoredExpressions( QList<QPair<QString, QString> > namedexpressions, const QString &tag )
|
||||
{
|
||||
Q_UNUSED( tag );
|
||||
|
@ -60,6 +60,14 @@ class CORE_EXPORT QgsStoredExpressionManager : public QObject
|
||||
*/
|
||||
void addStoredExpression( const QString &name, const QString &expression, const QString &tag = QString() );
|
||||
|
||||
/**
|
||||
* Removes an expression to the list
|
||||
*
|
||||
* \param name name of the expression as identification
|
||||
* \param tag some content, maybe scope where to be shown
|
||||
*/
|
||||
void removeStoredExpression( const QString &name, const QString &tag = QString() );
|
||||
|
||||
/**
|
||||
* Appends a list of expressions to the existing list
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user