diff --git a/imports/NeoChat/Component/Timeline/RichLabel.qml b/imports/NeoChat/Component/Timeline/RichLabel.qml index 8b42c38d9..843915643 100644 --- a/imports/NeoChat/Component/Timeline/RichLabel.qml +++ b/imports/NeoChat/Component/Timeline/RichLabel.qml @@ -52,6 +52,11 @@ TextEdit { persistentSelection: true + // Work around QTBUG 93281 + Component.onCompleted: if (text.includes(" table { width:100%; diff --git a/src/controller.cpp b/src/controller.cpp index b31154e09..05c4ec41d 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -684,3 +684,9 @@ bool Controller::encryptionSupported() const return false; #endif } + +void Controller::forceRefreshTextDocument(QQuickTextDocument *textDocument, QQuickItem *item) +{ + // HACK: Workaround bug QTBUG 93281 + connect(textDocument->textDocument(), SIGNAL(imagesLoaded()), item, SLOT(updateWholeDocument())); +} diff --git a/src/controller.h b/src/controller.h index 1df468738..1637c2ca5 100644 --- a/src/controller.h +++ b/src/controller.h @@ -96,6 +96,8 @@ public: Q_INVOKABLE QString plainText(QQuickTextDocument *document) const; bool encryptionSupported() const; + Q_INVOKABLE void forceRefreshTextDocument(QQuickTextDocument *textDocument, QQuickItem *item); + private: explicit Controller(QObject *parent = nullptr);