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 <hjk@qt.io>
This commit is contained in:
Eike Ziller
2019-11-13 11:05:06 +01:00
parent 7af9e0e827
commit 2c029d8700
2 changed files with 0 additions and 30 deletions

View File

@@ -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;
}
}

View File

@@ -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<void()> &action);
protected: