Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Change all the text to center like:
ui->textBrowser->setStyleSheet("text-align:center;");
Restore all the text to left:
ui->textBrowser->setStyleSheet("");
Hi The text alignment is part of the html/rich text inserted into the widget and since each paragraph can have its own alignment , i dont think its possible via Style sheet.
ui->textBrowser->selectAll(); ui->textBrowser->setAlignment(Qt::AlignCenter); ...... ui->textBrowser->selectAll(); ui->textBrowser->setAlignment(Qt::AlignLeft);