Setting text for QTextEdit
:
te->setPlainText(“Something”) ;
te->adjustSize();
should wrap around “Something” only, instead the QTextEdit
is expanding to its maximum Width-Height, can’t fix it..
When I select “Something” on run time, only “Something” is highlighted, no added extra white spaces.
Expectations: when text is small enough to fit on one Line, the text edit shouldn’t expand in height, when the text needs to wrap, only the extra line width should be added not the maximum width.
if adjustSize();
is not called, the text will wrap on the width that was set in the .ui in the Creator, won't dynamically expand horizontally nor vertically..
Some Info:
Horizontal Policy: Expanding
Vertical Policy : MinimumExpanding
minimumSize : 2×22
maximum Size : 300×100
lineWrapMode: WidgetWidth