Tag html on QString not applied when contains "\n"
Solved
General and Desktop
-
Hi,
I would like color some word on QLabel but html tag is displayed if my text contains "\n".ui->mylayout->addWidget(new QLabel(determineText())); QString MainWindow::determineInfoMixedCode(TableURC *myTable) { QString text = "test "; text += "\n"; text +=" <font color=red>with</font> color"; return text; }
display :
test <font color=red>with</font> color
But if I delete "\n", it works fine
QString MainWindow::determineInfoMixedCode(TableURC *myTable) { QString text = "test "; text +=" <font color=red>with</font> color"; return text; }