summaryrefslogtreecommitdiff
path: root/src/plugins/help
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2016-04-15 10:07:49 +0200
committerEike Ziller <eike.ziller@theqtcompany.com>2016-04-15 10:07:55 +0200
commit8a77eacf8d8c8f4877105e4758c7e587d01b4d83 (patch)
treef67167a3c1c5f63cde88d38a3606d90e567f6274 /src/plugins/help
parent0338f6909c5ca5f265018304b15227530ba787e0 (diff)
parent7080645d20adc20a025b99ccd116575901165af5 (diff)
downloadqt-creator-8a77eacf8d8c8f4877105e4758c7e587d01b4d83.tar.gz
Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
Diffstat (limited to 'src/plugins/help')
-rw-r--r--src/plugins/help/textbrowserhelpviewer.cpp16
-rw-r--r--src/plugins/help/textbrowserhelpviewer.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp
index fc61923613..611cf00609 100644
--- a/src/plugins/help/textbrowserhelpviewer.cpp
+++ b/src/plugins/help/textbrowserhelpviewer.cpp
@@ -448,3 +448,19 @@ void TextBrowserHelpWidget::mouseReleaseEvent(QMouseEvent *e)
QTextBrowser::mouseReleaseEvent(e);
}
+
+void TextBrowserHelpWidget::setSource(const QUrl &name)
+{
+ QTextBrowser::setSource(name);
+
+ 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 fccf79a532..5640fe10ad 100644
--- a/src/plugins/help/textbrowserhelpviewer.h
+++ b/src/plugins/help/textbrowserhelpviewer.h
@@ -96,6 +96,8 @@ public:
void scaleUp();
void scaleDown();
+ void setSource(const QUrl &name);
+
protected:
void contextMenuEvent(QContextMenuEvent *event);
bool eventFilter(QObject *obj, QEvent *event);