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!

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

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, privacy policy and cookie policy

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