@@ -175,9 +175,9 @@ void QgsActiveLayerFeaturesLocatorFilter::fetchResults( const QString &string, c
175175 QgsLocatorResult result;
176176 result.displayString = QStringLiteral ( " @%1" ).arg ( field );
177177 result.description = tr ( " Limit the search to the field '%1'" ).arg ( field );
178- result.userData = QVariantMap ( {{QStringLiteral ( " type" ), QVariant::fromValue ( ResultType::FieldRestriction )},
178+ result.setUserData ( QVariantMap ( {{QStringLiteral ( " type" ), QVariant::fromValue ( ResultType::FieldRestriction )},
179179 {QStringLiteral ( " search_text" ), QStringLiteral ( " %1 @%2 " ).arg ( prefix (), field ) }
180- } );
180+ } ) ) ;
181181 result.score = 1 ;
182182 emit resultFetched ( result );
183183 }
@@ -195,13 +195,13 @@ void QgsActiveLayerFeaturesLocatorFilter::fetchResults( const QString &string, c
195195 QgsLocatorResult result;
196196
197197 result.displayString = mDispExpression .evaluate ( &mContext ).toString ();
198- result.userData = QVariantMap (
198+ result.setUserData ( QVariantMap (
199199 {
200200 {QStringLiteral ( " type" ), QVariant::fromValue ( ResultType::Feature )},
201201 {QStringLiteral ( " feature_id" ), f.id ()},
202202 {QStringLiteral ( " layer_id" ), mLayerId },
203203 {QStringLiteral ( " layer_is_spatial" ), mLayerIsSpatial }
204- } );
204+ } ) ) ;
205205 result.icon = mLayerIcon ;
206206 result.score = static_cast < double >( searchString.length () ) / result.displayString .size ();
207207 if ( mLayerIsSpatial )
@@ -250,13 +250,13 @@ void QgsActiveLayerFeaturesLocatorFilter::fetchResults( const QString &string, c
250250 continue ; // not sure how this result slipped through...
251251
252252 result.description = mDispExpression .evaluate ( &mContext ).toString ();
253- result.userData = QVariantMap (
253+ result.setUserData ( QVariantMap (
254254 {
255255 {QStringLiteral ( " type" ), QVariant::fromValue ( ResultType::Feature )},
256256 {QStringLiteral ( " feature_id" ), f.id ()},
257257 {QStringLiteral ( " layer_id" ), mLayerId },
258258 {QStringLiteral ( " layer_is_spatial" ), mLayerIsSpatial }
259- } );
259+ } ) ) ;
260260 result.icon = mLayerIcon ;
261261 result.score = static_cast < double >( searchString.length () ) / result.displayString .size ();
262262 if ( mLayerIsSpatial )
@@ -278,7 +278,7 @@ void QgsActiveLayerFeaturesLocatorFilter::triggerResult( const QgsLocatorResult
278278
279279void QgsActiveLayerFeaturesLocatorFilter::triggerResultFromAction ( const QgsLocatorResult &result, const int actionId )
280280{
281- QVariantMap data = result.userData .value <QVariantMap>();
281+ QVariantMap data = result.getUserData () .value <QVariantMap>();
282282 switch ( data.value ( QStringLiteral ( " type" ) ).value <ResultType>() )
283283 {
284284 case ResultType::Feature:
0 commit comments