Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5, 6.6
-
None
Description
QLabel::setSelection uses displayed text, rich text will be ignored.
QLabel *label = new QLabel("<p>Rich text</p>"); QString text = label->text(); text.replace("<p>", "\n"); text.replace("<br>", "\n"); text.remove(QRegularExpression("<[^>]*>")); label->setSelection(0, int (text.length()));
Currently, QLabel does not has a public displayText method.