How to make QLabel expand width geometry to accommodate text
Asked Answered
S

1

0

I currently have a QLabel that has some text in it. However when I put some text in it that exceeds its geometrical width then that extra text is not displayed. I do not want to enable wordwrap since I want the QLabel to expand horizontally. Is there anyway that Qlabel could increase its geometrical width based on its content.

Sarre answered 9/12, 2013 at 2:31 Comment(2)
Have you tried appropriate size policy for the label like expanding or minimum expanding?Cabbala
Yes I did try setting those values.Sarre
L
1

Call QWidget::adjustSize() everytime you change the content of your label. I can't elaborate on other possible answers due to lack of information, but that will probably do the trick.

Lattermost answered 9/12, 2013 at 2:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.