I am making a script that works with labels.

Is it possible to turn on/off the display of unplaced labels with PyQGIS?

enter image description here

1 Answer 1


One way to do it would be to 'click' the button using PyQGIS:

for child in iface.mainWindow().children():
    if child.objectName() == 'mActionShowUnplacedLabels':

You can get its current state with:


enter image description here False

enter image description here True

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.