Skip to content

Commit

Permalink
in progress - solving map tip image bug
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed May 31, 2024
1 parent 26200a7 commit f4c0f4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/attributes/attributepreviewcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,22 @@ QVector<QPair<QString, QString>> AttributePreviewController::mapTipFields( )
return lst;
}

QString AttributePreviewController::mapTipImage( )
QString AttributePreviewController::mapTipImage()
{
QgsExpressionContext context( globalProjectLayerScopes( mFeatureLayerPair.layer() ) );
context.setFeature( mFeatureLayerPair.feature() );
QString mapTip = mFeatureLayerPair.layer()->mapTipTemplate();
QStringList lst = mapTip.split( '\n' ); // first line is "# image"

if ( lst.count() >= 2 )
return QgsExpression::replaceExpressionText( lst[1], &context );
{
QString expression = lst.mid( 1 ).join( '\n' );
return QgsExpression::replaceExpressionText( expression, &context );
}
else
{
return QString();
}
}

QString AttributePreviewController::mapTipHtml( )
Expand Down

1 comment on commit f4c0f4c

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.5.628011 just submitted!

Please sign in to comment.