How to make QLabel expand the width geometry to fit text

I currently have a QLabel that has text in it. However, when I put some text in it that exceeds its geometric width, then additional text is not displayed. I do not want to enable wordwrap since I want QLabel to expand horizontally. In any case, Qlabel can increase its geometric width based on its contents.

0
source share
1 answer

Call QWidget :: adjustSize () every time you change the contents of your label. I cannot elaborate on other possible answers due to lack of information, but this is likely to do the trick.

+1
source

Source: https://habr.com/ru/post/1693243/


All Articles