Skip to content

Commit

Permalink
Fix all Qt 5.14 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 16, 2020
1 parent 05f4359 commit 3717adc
Show file tree
Hide file tree
Showing 100 changed files with 193 additions and 187 deletions.
2 changes: 1 addition & 1 deletion src/3d/chunks/qgschunkedentity_p.cpp
Expand Up @@ -131,7 +131,7 @@ void QgsChunkedEntity::update( const SceneState &state )

int oldJobsCount = pendingJobsCount();

QSet<QgsChunkNode *> activeBefore = QSet<QgsChunkNode *>::fromList( mActiveNodes );
QSet<QgsChunkNode *> activeBefore = qgis::listToSet( mActiveNodes );
mActiveNodes.clear();
mFrustumCulled = 0;
mCurrentTime = QTime::currentTime();
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgs3dmapscene.cpp
Expand Up @@ -516,7 +516,7 @@ void Qgs3DMapScene::onLayerRenderer3DChanged()

void Qgs3DMapScene::onLayersChanged()
{
QSet<QgsMapLayer *> layersBefore = QSet<QgsMapLayer *>::fromList( mLayerEntities.keys() );
QSet<QgsMapLayer *> layersBefore = qgis::listToSet( mLayerEntities.keys() );
QList<QgsMapLayer *> layersAdded;
Q_FOREACH ( QgsMapLayer *layer, mMap.layers() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsvectorlayerdirector.cpp
Expand Up @@ -85,7 +85,7 @@ QgsAttributeList QgsVectorLayerDirector::requiredAttributes() const
{
attrs.unite( strategy->requiredAttributes() );
}
return attrs.toList();
return qgis::setToList( attrs );
}

QgsVectorLayerDirector::Direction QgsVectorLayerDirector::directionForFeature( const QgsFeature &feature ) const
Expand Down
Expand Up @@ -204,7 +204,7 @@ QVariantMap QgsCategorizeUsingStyleAlgorithm::processAlgorithm( const QVariantMa
uniqueVals << value;
}

QVariantList sortedUniqueVals = uniqueVals.toList();
QVariantList sortedUniqueVals = qgis::setToList( uniqueVals );
std::sort( sortedUniqueVals.begin(), sortedUniqueVals.end() );

QgsCategoryList cats;
Expand Down
Expand Up @@ -164,7 +164,7 @@ QVariantMap QgsDeleteDuplicateGeometriesAlgorithm::processAlgorithm( const QVari

// now, fetch all the feature attributes for the unique features only
// be super-smart and don't re-fetch geometries
QSet< QgsFeatureId > outputFeatureIds = uniqueFeatures.keys().toSet();
QSet< QgsFeatureId > outputFeatureIds = qgis::listToSet( uniqueFeatures.keys() );
outputFeatureIds.unite( nullGeometryFeatures );
step = outputFeatureIds.empty() ? 1 : 100.0 / outputFeatureIds.size();

Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmlineintersection.cpp
Expand Up @@ -125,7 +125,7 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
continue;

QgsGeometry inGeom = inFeatureA.geometry();
QgsFeatureIds lines = spatialIndex.intersects( inGeom.boundingBox() ).toSet();
QgsFeatureIds lines = qgis::listToSet( spatialIndex.intersects( inGeom.boundingBox() ) );
if ( !lines.empty() )
{
// use prepared geometries for faster intersection tests
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmrandomextract.cpp
Expand Up @@ -121,7 +121,7 @@ QVariantMap QgsRandomExtractAlgorithm::processAlgorithm( const QVariantMap &para
idsCount[ id ] += 1;
}

QgsFeatureIds ids = QSet< QgsFeatureId >::fromList( idsCount.keys() );
QgsFeatureIds ids = qgis::listToSet( idsCount.keys() );
QgsFeatureIterator fit = source->getFeatures( QgsFeatureRequest().setFilterFids( ids ), QgsProcessingFeatureSource::FlagSkipGeometryValidityChecks );

QgsFeature f;
Expand Down
Expand Up @@ -199,7 +199,7 @@ QVariantMap QgsServiceAreaFromLayerAlgorithm::processAlgorithm( const QVariantMa
} // costs

// convert to list and sort to maintain same order of points between algorithm runs
QList< int > verticesList = vertices.toList();
QList< int > verticesList = qgis::setToList( vertices );
areaPoints.reserve( verticesList.size() );
std::sort( verticesList.begin(), verticesList.end() );
for ( int v : verticesList )
Expand Down
Expand Up @@ -164,7 +164,7 @@ QVariantMap QgsServiceAreaFromPointAlgorithm::processAlgorithm( const QVariantMa
} // costs

// convert to list and sort to maintain same order of points between algorithm runs
QList< int > verticesList = vertices.toList();
QList< int > verticesList = qgis::setToList( vertices );
points.reserve( verticesList.size() );
std::sort( verticesList.begin(), verticesList.end() );
for ( int v : verticesList )
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmsplitwithlines.cpp
Expand Up @@ -146,7 +146,7 @@ QVariantMap QgsSplitWithLinesAlgorithm::processAlgorithm( const QVariantMap &par

QVector< QgsGeometry > inGeoms = inGeom.asGeometryCollection();

const QgsFeatureIds lines = spatialIndex.intersects( inGeom.boundingBox() ).toSet();
const QgsFeatureIds lines = qgis::listToSet( spatialIndex.intersects( inGeom.boundingBox() ) );
if ( !lines.empty() ) // has intersection of bounding boxes
{
QVector< QgsGeometry > splittingLines;
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsoverlayutils.cpp
Expand Up @@ -104,7 +104,7 @@ void QgsOverlayUtils::difference( const QgsFeatureSource &sourceA, const QgsFeat
if ( featA.hasGeometry() )
{
QgsGeometry geom( featA.geometry() );
QgsFeatureIds intersects = indexB.intersects( geom.boundingBox() ).toSet();
QgsFeatureIds intersects = qgis::listToSet( indexB.intersects( geom.boundingBox() ) );

QgsFeatureRequest request;
request.setFilterFids( intersects );
Expand Down Expand Up @@ -209,7 +209,7 @@ void QgsOverlayUtils::intersection( const QgsFeatureSource &sourceA, const QgsFe
continue;

QgsGeometry geom( featA.geometry() );
QgsFeatureIds intersects = indexB.intersects( geom.boundingBox() ).toSet();
QgsFeatureIds intersects = qgis::listToSet( indexB.intersects( geom.boundingBox() ) );

QgsFeatureRequest request;
request.setFilterFids( intersects );
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/geometry_checker/qgsfeaturepool.cpp
Expand Up @@ -100,7 +100,7 @@ QgsFeatureIds QgsFeaturePool::allFeatureIds() const
QgsFeatureIds QgsFeaturePool::getIntersects( const QgsRectangle &rect ) const
{
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Read );
QgsFeatureIds ids = QgsFeatureIds::fromList( mIndex.intersects( rect ) );
QgsFeatureIds ids = qgis::listToSet( mIndex.intersects( rect ) );
return ids;
}

Expand Down
Expand Up @@ -62,7 +62,7 @@ void QgsGeometryFollowBoundariesCheck::collectErrors( const QMap<QString, QgsFea
// Get potential reference features
QgsRectangle searchBounds = geomt.constGet()->boundingBox();
searchBounds.grow( mContext->tolerance );
QgsFeatureIds refFeatureIds = mIndex->intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mIndex->intersects( searchBounds ) );

QgsFeatureRequest refFeatureRequest = QgsFeatureRequest().setFilterFids( refFeatureIds ).setNoAttributes();
QgsFeatureIterator refFeatureIt = mCheckLayer->getFeatures( refFeatureRequest );
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/vector/qgsgeometrysnapper.cpp
Expand Up @@ -485,7 +485,7 @@ QgsGeometry QgsGeometrySnapper::snapGeometry( const QgsGeometry &geometry, doubl
mIndexMutex.lock();
QgsRectangle searchBounds = geometry.boundingBox();
searchBounds.grow( snapTolerance );
QgsFeatureIds refFeatureIds = mIndex.intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mIndex.intersects( searchBounds ) );
mIndexMutex.unlock();

QgsFeatureRequest refFeatureRequest = QgsFeatureRequest().setFilterFids( refFeatureIds ).setNoAttributes();
Expand Down Expand Up @@ -758,7 +758,7 @@ QgsGeometry QgsInternalGeometrySnapper::snapFeature( const QgsFeature &feature )
// Get potential reference features and construct snap index
QgsRectangle searchBounds = geometry.boundingBox();
searchBounds.grow( mSnapTolerance );
QgsFeatureIds refFeatureIds = mProcessedIndex.intersects( searchBounds ).toSet();
QgsFeatureIds refFeatureIds = qgis::listToSet( mProcessedIndex.intersects( searchBounds ) );
if ( !refFeatureIds.isEmpty() )
{
QList< QgsGeometry > refGeometries;
Expand Down
4 changes: 4 additions & 0 deletions src/app/dwg/qgsdwgimporter.cpp
Expand Up @@ -834,7 +834,11 @@ void QgsDwgImporter::addLType( const DRW_LType &data )
setString( dfn, f.get(), QStringLiteral( "name" ), name );
SETSTRINGPTR( desc );

#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QVector<double> path( QVector<double>::fromStdVector( data.path ) );
#else
QVector<double> path( data.path.begin(), data.path.end() );
#endif
OGR_F_SetFieldDoubleList( f.get(), OGR_FD_GetFieldIndex( dfn, "path" ), path.size(), path.data() );

QVector<double> upath;
Expand Down
2 changes: 1 addition & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -379,7 +379,7 @@ void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const Qg
expression.prepare( &context );

QgsFeatureRequest req;
req.setSubsetOfAttributes( expression.referencedAttributeIndexes( layer->fields() ).toList() );
req.setSubsetOfAttributes( qgis::setToList( expression.referencedAttributeIndexes( layer->fields() ) ) );
if ( !expression.needsGeometry() )
req.setFlags( QgsFeatureRequest::NoGeometry );
QString enhancedSearch = string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -12889,7 +12889,7 @@ bool QgisApp::checkTasksDependOnProject()
if ( !activeTaskDescriptions.isEmpty() )
{
QMessageBox::warning( this, tr( "Active Tasks" ),
tr( "The following tasks are currently running which depend on layers in this project:\n\n%1\n\nPlease cancel these tasks and retry." ).arg( activeTaskDescriptions.toList().join( QStringLiteral( "\n" ) ) ) );
tr( "The following tasks are currently running which depend on layers in this project:\n\n%1\n\nPlease cancel these tasks and retry." ).arg( qgis::setToList( activeTaskDescriptions ).join( QStringLiteral( "\n" ) ) ) );
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -636,7 +636,7 @@ void QgsAttributeTableDialog::mActionCopySelectedRows_triggered()
}
featureStore.setFields( fields );

QgsFeatureIterator it = mLayer->getFeatures( QgsFeatureRequest( featureIds.toSet() )
QgsFeatureIterator it = mLayer->getFeatures( QgsFeatureRequest( qgis::listToSet( featureIds ) )
.setSubsetOfAttributes( fieldNames, mLayer->fields() ) );
QgsFeatureMap featureMap;
QgsFeature feature;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsbookmarkeditordialog.cpp
Expand Up @@ -39,8 +39,8 @@ QgsBookmarkEditorDialog::QgsBookmarkEditorDialog( QgsBookmark bookmark, bool inP

mName->setText( mBookmark.name() );

QSet<QString> groups = QSet<QString>::fromList( QgsProject::instance()->bookmarkManager()->groups() << QgsApplication::instance()->bookmarkManager()->groups() );
QStringList groupsList = groups.toList();
QSet<QString> groups = qgis::listToSet( QgsProject::instance()->bookmarkManager()->groups() << QgsApplication::instance()->bookmarkManager()->groups() );
QStringList groupsList = qgis::setToList( groups );
groupsList.removeOne( QString() );
groupsList.sort();
mGroup->addItems( groupsList );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdxfexportdialog.cpp
Expand Up @@ -350,7 +350,7 @@ void QgsVectorLayerAndAttributeModel::applyVisibilityPreset( const QString &name
}
else
{
visibleLayers = QgsProject::instance()->mapThemeCollection()->mapThemeVisibleLayerIds( name ).toSet();
visibleLayers = qgis::listToSet( QgsProject::instance()->mapThemeCollection()->mapThemeVisibleLayerIds( name ) );
}

if ( visibleLayers.isEmpty() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsgeometryvalidationmodel.cpp
Expand Up @@ -246,7 +246,7 @@ void QgsGeometryValidationModel::setCurrentLayer( QgsVectorLayer *currentLayer )
mDisplayExpression = mCurrentLayer ? mCurrentLayer->displayExpression() : QString();
mExpressionContext = QgsExpressionContext( QgsExpressionContextUtils::globalProjectLayerScopes( mCurrentLayer ) );
mDisplayExpression.prepare( &mExpressionContext );
mRequiredAttributes = mDisplayExpression.referencedColumns().toList();
mRequiredAttributes = qgis::setToList( mDisplayExpression.referencedColumns() );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -414,8 +414,8 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
QgsFeatureIds affectedFeatureIds;
if ( layer->editBuffer() )
{
affectedFeatureIds = layer->editBuffer()->changedGeometries().keys().toSet();
affectedFeatureIds.unite( layer->editBuffer()->addedFeatures().keys().toSet() );
affectedFeatureIds = qgis::listToSet( layer->editBuffer()->changedGeometries().keys() );
affectedFeatureIds.unite( qgis::listToSet( layer->editBuffer()->addedFeatures().keys() ) );
}

const QString layerId = layer->id();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -601,7 +601,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << QString() << action->text() );
twi->setIcon( 0, QgsApplication::getThemeIcon( QStringLiteral( "/mAction.svg" ) ) );
twi->setData( 0, Qt::UserRole, "map_layer_action" );
twi->setData( 0, Qt::UserRole + 1, qVariantFromValue( qobject_cast<QObject *>( action ) ) );
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( qobject_cast<QObject *>( action ) ) );
actionItem->addChild( twi );

connect( action, &QObject::destroyed, this, &QgsIdentifyResultsDialog::mapLayerActionDestroyed );
Expand Down Expand Up @@ -851,7 +851,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
if ( !( QgsRasterDataProvider::identifyFormatToCapability( f ) & capabilities ) )
continue;
formatCombo->addItem( QgsRasterDataProvider::identifyFormatLabel( f ), f );
formatCombo->setItemData( formatCombo->count() - 1, qVariantFromValue( qobject_cast<QObject *>( layer ) ), Qt::UserRole + 1 );
formatCombo->setItemData( formatCombo->count() - 1, QVariant::fromValue( qobject_cast<QObject *>( layer ) ), Qt::UserRole + 1 );
if ( currentFormat == f )
formatCombo->setCurrentIndex( formatCombo->count() - 1 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolrotatepointsymbols.cpp
Expand Up @@ -77,7 +77,7 @@ void QgsMapToolRotatePointSymbols::canvasPressEvent( QgsMapMouseEvent *e )
void QgsMapToolRotatePointSymbols::canvasPressOnFeature( QgsMapMouseEvent *e, const QgsFeature &feature, const QgsPointXY &snappedPoint )
{
//find out initial arrow direction
QVariant attrVal = feature.attribute( mCurrentRotationAttributes.toList().at( 0 ) );
QVariant attrVal = feature.attribute( qgis::setToList( mCurrentRotationAttributes ).at( 0 ) );

mCurrentRotationFeature = attrVal.toDouble();
createPixmapItem( mMarkerSymbol.get() );
Expand Down
6 changes: 3 additions & 3 deletions src/app/vertextool/qgsvertextool.cpp
Expand Up @@ -1005,7 +1005,7 @@ void QgsVertexTool::tryToSelectFeature( QgsMapMouseEvent *e )
mLockedFeatureAlternatives->alternatives.append( firstChoice );
alternatives.remove( firstChoice );
}
mLockedFeatureAlternatives->alternatives.append( alternatives.toList() );
mLockedFeatureAlternatives->alternatives.append( qgis::setToList( alternatives ) );

if ( mLockedFeature )
{
Expand Down Expand Up @@ -2222,13 +2222,13 @@ void QgsVertexTool::deleteVertex()
QSet<Vertex> toDelete;
if ( !mSelectedVertices.isEmpty() )
{
toDelete = QSet<Vertex>::fromList( mSelectedVertices );
toDelete = qgis::listToSet( mSelectedVertices );
}
else
{
bool addingVertex = mDraggingVertexType == AddingVertex || mDraggingVertexType == AddingEndpoint;
toDelete << *mDraggingVertex;
toDelete += QSet<Vertex>::fromList( mDraggingExtraVertices );
toDelete += qgis::listToSet( mDraggingExtraVertices );

if ( addingVertex )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/auth/qgsauthmanager.cpp
Expand Up @@ -2266,7 +2266,7 @@ bool QgsAuthManager::updateIgnoredSslErrorsCacheFromConfig( const QgsAuthConfigS
QList<QSslError::SslError> errenums( config.sslIgnoredErrorEnums() );
if ( !errenums.isEmpty() )
{
mIgnoredSslErrorsCache.insert( shahostport, QSet<QSslError::SslError>::fromList( errenums ) );
mIgnoredSslErrorsCache.insert( shahostport, qgis::listToSet( errenums ) );
QgsDebugMsg( QStringLiteral( "Update of ignored SSL errors cache SUCCEEDED for sha:host:port = %1" ).arg( shahostport ) );
dumpIgnoredSslErrorsCache_();
return true;
Expand Down Expand Up @@ -2347,7 +2347,7 @@ bool QgsAuthManager::rebuildIgnoredSslErrorCache()
QList<QSslError::SslError> errenums( config.sslIgnoredErrorEnums() );
if ( !errenums.isEmpty() )
{
nextcache.insert( shahostport, QSet<QSslError::SslError>::fromList( errenums ) );
nextcache.insert( shahostport, qgis::listToSet( errenums ) );
}
if ( prevcache.contains( shahostport ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpression.cpp
Expand Up @@ -250,7 +250,7 @@ QSet<int> QgsExpression::referencedAttributeIndexes( const QgsFields &fields ) c
{
if ( fieldName == QgsFeatureRequest::ALL_ATTRIBUTES )
{
referencedIndexes = fields.allAttributesList().toSet();
referencedIndexes = qgis::listToSet( fields.allAttributesList() );
break;
}
const int idx = fields.lookupField( fieldName );
Expand Down
Expand Up @@ -147,7 +147,7 @@ QVariant QgsRelationReferenceFieldFormatter::createCache( QgsVectorLayer *layer,

QgsFeatureRequest request;
request.setFlags( QgsFeatureRequest::NoGeometry );
QgsAttributeList requiredAttributes = expr.referencedAttributeIndexes( referencedLayer->fields() ).toList();
QgsAttributeList requiredAttributes = qgis::setToList( expr.referencedAttributeIndexes( referencedLayer->fields() ) );
requiredAttributes << referencedFieldIdx;
request.setSubsetOfAttributes( requiredAttributes );
QgsFeature feature;
Expand Down Expand Up @@ -196,7 +196,7 @@ QVariantList QgsRelationReferenceFieldFormatter::availableValues( const QVariant
if ( referencedLayer )
{
int fieldIndex = context.project()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedFields().first();
values = referencedLayer->uniqueValues( fieldIndex, countLimit ).toList();
values = qgis::setToList( referencedLayer->uniqueValues( fieldIndex, countLimit ) );
}
}
return values;
Expand Down
14 changes: 6 additions & 8 deletions src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
Expand Up @@ -147,7 +147,7 @@ QgsValueRelationFieldFormatter::ValueRelationCache QgsValueRelationFieldFormatte
QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( layer ) );
descriptionExpression.prepare( &context );
subsetOfAttributes += descriptionExpression.referencedAttributeIndexes( layer->fields() );
request.setSubsetOfAttributes( subsetOfAttributes.toList() );
request.setSubsetOfAttributes( qgis::setToList( subsetOfAttributes ) );

const QString filterExpression = config.value( QStringLiteral( "FilterExpression" ) ).toString();

Expand Down Expand Up @@ -219,7 +219,7 @@ QVariantList QgsValueRelationFieldFormatter::availableValues( const QVariantMap
if ( referencedLayer )
{
int fieldIndex = referencedLayer->fields().indexOf( config.value( QStringLiteral( "Key" ) ).toString() );
values = referencedLayer->uniqueValues( fieldIndex, countLimit ).toList();
values = qgis::setToList( referencedLayer->uniqueValues( fieldIndex, countLimit ) );
}
}
return values;
Expand Down Expand Up @@ -291,7 +291,7 @@ QStringList QgsValueRelationFieldFormatter::valueToStringList( const QVariant &v
QSet<QString> QgsValueRelationFieldFormatter::expressionFormVariables( const QString &expression )
{
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::formScope() );
QSet< QString > formVariables = scope->variableNames().toSet();
QSet< QString > formVariables = qgis::listToSet( scope->variableNames() );
const QSet< QString > usedVariables = QgsExpression( expression ).referencedVariables();
formVariables.intersect( usedVariables );
return formVariables;
Expand All @@ -300,7 +300,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionFormVariables( const QSt
QSet<QString> QgsValueRelationFieldFormatter::expressionParentFormVariables( const QString &expression )
{
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::parentFormScope() );
QSet< QString > formVariables = scope->variableNames().toSet();
QSet< QString > formVariables = qgis::listToSet( scope->variableNames() );
const QSet< QString > usedVariables = QgsExpression( expression ).referencedVariables();
formVariables.intersect( usedVariables );
return formVariables;
Expand All @@ -322,8 +322,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionParentFormAttributes( co
QgsExpression exp( expression );
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::parentFormScope() );
// List of form function names used in the expression
const QSet<QString> formFunctions( scope->functionNames()
.toSet()
const QSet<QString> formFunctions( qgis::listToSet( scope->functionNames() )
.intersect( exp.referencedFunctions( ) ) );
const QList<const QgsExpressionNodeFunction *> expFunctions( exp.findNodes<QgsExpressionNodeFunction>() );
QgsExpressionContext context;
Expand All @@ -347,8 +346,7 @@ QSet<QString> QgsValueRelationFieldFormatter::expressionFormAttributes( const QS
QgsExpression exp( expression );
std::unique_ptr< QgsExpressionContextScope > scope( QgsExpressionContextUtils::formScope() );
// List of form function names used in the expression
const QSet<QString> formFunctions( scope->functionNames()
.toSet()
const QSet<QString> formFunctions( qgis::listToSet( scope->functionNames() )
.intersect( exp.referencedFunctions( ) ) );
const QList<const QgsExpressionNodeFunction *> expFunctions( exp.findNodes<QgsExpressionNodeFunction>() );
QgsExpressionContext context;
Expand Down

0 comments on commit 3717adc

Please sign in to comment.