Qt: Escape HTML when setting ElidedLabel text
ElidedLabels use Qt's rich text internally, but we need to make sure the text we're passed via setText() is plain. Fixes #18774
This commit is contained in:
parent
1c24e49c67
commit
d9adb6f712
|
@ -74,6 +74,6 @@ void ElidedLabel::clear()
|
|||
|
||||
void ElidedLabel::setText(const QString &text)
|
||||
{
|
||||
full_text_ = text;
|
||||
full_text_ = text.toHtmlEscaped();
|
||||
updateText();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,10 @@ public slots:
|
|||
* @brief clear Clear the label.
|
||||
*/
|
||||
void clear();
|
||||
/**
|
||||
* @brief setText Set the label's plain text.
|
||||
* @param text The text to set. HTML will be escaped.
|
||||
*/
|
||||
void setText(const QString &text);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue