Skip to content

Update whole layout on setText

Carl Schwan requested to merge work/carl/fix-layout-when-changing-text into master

Only updating the geometry breaks when the size of text is updated.

Before:

image

(Text is cut off)

After:

image

auto mw = new KMessageWidget;

mw->setText(QStringLiteral("<p>This message is encrypted. <a href=\"messageviewer:showDetails\">Details</a></p>"));

connect(mw, &KMessageWidget::linkActived, this, [mw](const QString &) {
    mw->setText("<p>This message is encrypted. The message is encrypted for the following keys:</p><p><ul><li>113BDDDFEC5DDE16</li></ul></p>");
});

Merge request reports