forked from qt-creator/qt-creator
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:
@@ -457,27 +457,3 @@ void TextBrowserHelpWidget::resizeEvent(QResizeEvent *e)
|
|||||||
QTextBrowser::resizeEvent(e);
|
QTextBrowser::resizeEvent(e);
|
||||||
scrollToTextPosition(topTextPosition);
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -92,12 +92,6 @@ public:
|
|||||||
void scaleUp();
|
void scaleUp();
|
||||||
void scaleDown();
|
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);
|
void withFixedTopPosition(const std::function<void()> &action);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user