qtqt-designertext-alignmentqlabel

text in label incorrectly displayed


I'm unable to correctly display a text on a QLabel, here's how it looks:

enter image description here

How do I modify it to get this result:

The result


Solution

  • In code: after create widget you can try to relocate your text using setAligment fuction, in class QLabel. For example, locating text from top to down:

    myLabel->setAlignment(Qt::AlignTop)
    

    In Designer you can use field Aligment-Vertical.