From 2c029d870095ebd63ea0203d465e5cd293ea8bcf Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 13 Nov 2019 11:05:06 +0100 Subject: [PATCH] Help: Remove hack for fixed Qt issue The hack was a workaround for QTBUG-51962 which is fixed since Qt 5.7 Change-Id: Iad76d72359f19febecb98b245a950684e6bba16f Reviewed-by: hjk --- src/plugins/help/textbrowserhelpviewer.cpp | 24 ---------------------- src/plugins/help/textbrowserhelpviewer.h | 6 ------ 2 files changed, 30 deletions(-) diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp index 67171567bfc..b388d247424 100644 --- a/src/plugins/help/textbrowserhelpviewer.cpp +++ b/src/plugins/help/textbrowserhelpviewer.cpp @@ -457,27 +457,3 @@ void TextBrowserHelpWidget::resizeEvent(QResizeEvent *e) QTextBrowser::resizeEvent(e); scrollToTextPosition(topTextPosition); } - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void TextBrowserHelpWidget::setSource(const QUrl &name) -#else -void TextBrowserHelpWidget::doSetSource(const QUrl &name, QTextDocument::ResourceType type) -#endif -{ -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QTextBrowser::setSource(name); -#else - QTextBrowser::doSetSource(name, type); -#endif - - QTextCursor cursor(document()); - while (!cursor.atEnd()) { - QTextBlockFormat fmt = cursor.blockFormat(); - if (fmt.hasProperty(QTextFormat::LineHeightType) && fmt.lineHeightType() == QTextBlockFormat::FixedHeight) { - fmt.setProperty(QTextFormat::LineHeightType, QTextBlockFormat::MinimumHeight); - cursor.setBlockFormat(fmt); - } - if (!cursor.movePosition(QTextCursor::NextBlock)) - break; - } -} diff --git a/src/plugins/help/textbrowserhelpviewer.h b/src/plugins/help/textbrowserhelpviewer.h index ff185c4a57d..b29517e61eb 100644 --- a/src/plugins/help/textbrowserhelpviewer.h +++ b/src/plugins/help/textbrowserhelpviewer.h @@ -92,12 +92,6 @@ public: void scaleUp(); void scaleDown(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void setSource(const QUrl &name) override; -#else - void doSetSource(const QUrl &url, QTextDocument::ResourceType type) override; -#endif - void withFixedTopPosition(const std::function &action); protected: