4

I am using QGIS (sadly only 2.8) and I have a label on my dataset. It currently looks like this:

    "MP_Lookup_Constituency" || '\n' ||  "MP_Lookup_Name" +' ('+"MP_Lookup_Party"+')'

The Constituency appears above the rest of the text, but I'd like to (not sure if possible) just underline this part of the label. So the Constituency is underlined, but the rest isn't. I've tinkered with different things, but no joy, so any help would be amazing!

2
  • Interestingly <u></u> works in the Output preview but not on the map
    – Ian Turton
    Commented Dec 4, 2017 at 17:14
  • 2
    The output label is a QLabel which supports HTML I really should fix that... ;)
    – Nathan W
    Commented Dec 5, 2017 at 7:24

1 Answer 1

5

The only way I can think about doing this is setting up 2 rules and underlining only 1 of them:

enter image description here

enter image description here

You'll have to pay attention to the offset properties of both rules, but it should work with a bit of tweaking.

Here I've set the anchor to the RIGHT position and used the X and Y offset to place the labels:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.