Bug report #10365

QgsExpression::expression() incorrectly returns escaped strings

Added by Nyall Dawson about 10 years ago. Updated about 10 years ago.

Assignee:Jürgen Fischer
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18784


I'm pretty sure I've tracked this down to QgsExpression::expression() - steps to reproduce:

1. Add a layer to the map
2. In the layer's style, click data defined properties
3. Add an expression for a parameter " '\\\
' "
4. Click OK
5. Click "Data defined properties" again. The expression has stripped the extra "\\" and is now just " '\
' ".
6. Click OK then reopen the data defined properties dialog - the expression will now be just ''.

Labeling doesn't seem to suffer this same issue, I can only reproduce it in the data defined properties dialog.

Associated revisions

Revision 882912f7
Added by Martin Dobias about 10 years ago

Fix #10365 (incorrectly escaped strings from QgsExpression)


#1 Updated by Nathan Woodrow about 10 years ago

This problem lives somewhere else because:

exp = QgsExpression(r"'\\\

#2 Updated by Jürgen Fischer about 10 years ago

  • Assignee set to Jürgen Fischer

#3 Updated by Martin Dobias about 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF