Authored by antonanikin on Oct 29 2016, 12:47 PM.

Description

Fix QtHelp

Summary:
This patch fixes broken code-context help. Old version has buggy behavior:

  1. Place following code to some source file (line numbers is for example):
1: QHBoxLayout hbl;
2: QLayout* l = &hbl;
3: l->addWidget(new QPushButton);
4: hbl.addWidget(new QPushButton);

Restart KDevelop.

  1. Place cursor to addWidget in line 3 and call "Show Documentation" from context menu. Help page is shown and all it's OK.
  1. Place cursor to addWidget in line 4 and call help again. Help page is shown but with wrong contents.
  1. Place cursor again to addWidget in line 3 and call "Show documentation". Help page is shown but again with wrong contents.
  1. Such broken search will happens until next restart.

This behavior caused by wrong usage of documentation Url - it passed as baseUrl parameter of QWebView::setContent() method, which is wrong. Qt doc says:

External objects referenced in the content are located relative to baseUrl.

Therefore new version uses setUrl() method to set correct documentation Url.

Test Plan: Tested on master branch. The presented example works as it must.

Reviewers: brauch, KDevelop

Reviewed By: brauch, KDevelop

Subscribers: brauch, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D3197

Details

Committed
antonanikinOct 29 2016, 12:50 PM
Reviewer
KDevelop
Differential Revision
D3197: Fix QtHelp
Parents
R32:b2b254e197e5: Fetch fileutils_mac.mm from qt-creator master
Branches
Unknown
Tags
Unknown