문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top