I have a simple program like this:
#include <QTextEdit>
#include <QApplication>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QTextEdit *te = new QTextEdit();
te->setLineWrapMode(QTextEdit::WidgetWidth);
te->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
te->document()->setDefaultTextOption(QTextOption(Qt::AlignRight));
te->show();
return app.exec();
}
this code seems to not wrap correctly at the end of a widget. If, for example, you fill the line with random letters it doesn’t jump to the next line when the limit is reached. If I remove the alignment it works perfectly. Is there any options I must set for it to work correctly?
Thank you in advance.
↧