Commit 1cf2d297 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port QTextBrowser::setSource override method

parent 22c2eae3
Pipeline #145881 passed with stage
in 1 minute and 33 seconds
......@@ -32,8 +32,15 @@ TextBrowser::TextBrowser(QWidget *parent)
setFrameStyle(QFrame::NoFrame);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void TextBrowser::setSource(const QUrl &name)
#else
void TextBrowser::doSetSource(const QUrl &name, QTextDocument::ResourceType type)
#endif
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Q_UNUSED(type);
#endif
QString uri = name.toString();
// QTextBrowser for some reason insists on putting // or / in links,
// this is a crude workaround
......
......@@ -18,7 +18,11 @@ class TextBrowser : public QTextBrowser
public:
explicit TextBrowser(QWidget *parent = nullptr);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void setSource(const QUrl &name) override;
#else
void doSetSource(const QUrl &name, QTextDocument::ResourceType type = QTextDocument::UnknownResource) override;
#endif
Q_SIGNALS:
void attachmentUrlClicked(const QString &uri);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment