<table><tr><td style="">rjvbb added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8211" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Thanks for speaking my mind (too) stronger than I dared :)</p>

<p>Here's what I meant with collaborative: maybe those of us who'd like to see this get in could try the patch for a while, see what works, what doesn't, and what can be improved? Note that I've focussed on the QtHelp documentation, have done only a few quick checks of CMake docs and didn't try the manpage plugin at all as yet.</p>

<p>I see that the RB ticket mentions how the patch under review doesn't allow to follow links in QtHelp docs. Figuring out how to do that (without ending up in an unending reload loop) was what took me the most time, and is why I'm deriving QTextBrowser. The real tricky thing is that, ideally, StandardDocumentationView would need direct access to QHelp* APIs to fetch the content of <tt style="background: #ebebeb; font-size: 13px;">qthelp:</tt> URLs.</p>

<p>Basically, you need to override <tt style="background: #ebebeb; font-size: 13px;">QTextBrowser::loadResource(type,url)</tt> with a method that can invoke <tt style="background: #ebebeb; font-size: 13px;">QHelpEngine::fileData(url)</tt> and return that content. I am currently working around that by using a new <tt style="background: #ebebeb; font-size: 13px;">StandardDocumentView::load(url,content)</tt> method in the QtHelp plugin. I think that's safe because (I think) we shouldn't ever be in a situation where we cannot do that. The obvious other approach would be to provide StandardDocumentationView with a callback to a QtHelpDocumentation method which does the work, for instance a closer clone of the Assistant's</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QVariant HelpViewer::loadResource(int type, const QUrl &name)
{
    QByteArray ba;
    if (type < 4) {
        const QUrl url = HelpEngineWrapper::instance().findFile(name);
        ba = HelpEngineWrapper::instance().fileData(url);
        if (url.toString().endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) {
            QImage image;
            image.loadFromData(ba, "svg");
            if (!image.isNull())
                return image;
        }
    }
    return ba;
}</pre></div>

<p>(Having support for some types of images could be nice, but is it useful?)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8211" rel="noreferrer">https://phabricator.kde.org/D8211</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop<br /><strong>Cc: </strong>flherne, arichardson, apol, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>