I've created a QTextEdit which initializes empty, after that the following code executes (TE being a pointer to the textedit):
TE->setText( "this is a test string, it should have a non zero height");
auto d(TE->document());
auto s(d->toPlainText());
auto _s(d->size());
auto _h(_s.height());
Through debugging I see that the string s
is set correctly. However the size _s
simply is 0. Why, and how to fix. Shouldn't this snipped work everywhere and in any place? I've also tried adding a TE->show()
line in case the resizing only happens when showing the widget, but to no avail. What is causing this?