Port from KHTML to QtWebEngine
Needs RevisionPublic

Authored by svuorela on Sep 11 2019, 8:51 AM.

Details

Summary

Still relies on the man and help kioslaves.

Features lost:

  • printing
  • the abitility to trigger next/previous chapter from the shell
  • the ability to with space automatic switch chapter
  • custom right click menues. The QtWE probably fits us

This kind of fixes T11541

Test Plan

Clicked a bit around, things kind of work. But there are likely bugs still.

The reviewers are some dinosaurs to have a chance of finding errors, and someone my memory identifies as documentation people.

Diff Detail

Repository
R125 KHelpCenter
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16367
Build 16385: arc lint + arc unit
svuorela created this revision.Sep 11 2019, 8:51 AM
Restricted Application added a project: Documentation. · View Herald TranscriptSep 11 2019, 8:51 AM
Restricted Application added a subscriber: kde-doc-english. · View Herald Transcript
svuorela requested review of this revision.Sep 11 2019, 8:51 AM
svuorela updated this revision to Diff 65825.Sep 11 2019, 8:54 AM

Forgot some removed files

Thanks, you have been fast. Would it be possible to use the QWebEngine-based KPart currently in konqueror.git?

Adding Montel because he has experience with locking QtWE down for e.g. mail usage.

Thanks, you have been fast. Would it be possible to use the QWebEngine-based KPart currently in konqueror.git?

I'm not sure it makes much sense - we aren't doing kpart loading, just embedding a widgett.

And a lot of the code in the webengine part is about cookies handling, wallet handling, SSL handling, all irrelevant for KHelpCenter.

mlaurent requested changes to this revision.Sep 11 2019, 11:08 AM
mlaurent added inline comments.
mainwindow.cpp
263

We still have zoom support in webengine. see setZoomFactor
I think that it's useful to be able to increase/decrease it.

292

Print support can be implemented

I use a code as it:
bool WebEnginePage::execPrintPreviewPage(QPrinter *printer, int timeout)
{

QPointer<QEventLoop> loop = new QEventLoop;
bool result = false;
QTimer::singleShot(timeout, loop.data(), &QEventLoop::quit);

print(printer, [loop, &result](bool res) {
    if (loop && loop->isRunning()) {
        result = res;
        loop->quit();
    }
});

loop->exec();
delete loop;

return result;

}
see WebEnginePage

view.cpp
213

QAction *QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
can generate some actions.

This revision now requires changes to proceed.Sep 11 2019, 11:08 AM

You removed font settings dialog.
But we can add default font as it:

const QFontInfo font(QFontDatabase().systemFont(QFontDatabase::GeneralFont));
settings()->setFontFamily(QWebEngineSettings::StandardFont, font.family());
settings()->setFontSize(QWebEngineSettings::DefaultFontSize, font.pixelSize());

I think QTextBrowser fits better than WebEngine.

So what is the status of this patch ?

So what is the status of this patch ?

I have played a bit around with QTextBrowser, but couldn't get a working result yet.

And life kind of happened.

I have played a bit around with QTextBrowser, but couldn't get a working result yet.

I don't want to block the patch, it was a thinking not a real investigation in code base.

Technically I think that an hard dependency on QtWebEngine is a mistake, and that both engines should be available (QTextBrowser too).
Sune thinks that this would be not wise. Oh, well. As I don't want to block this right now (but it can be changed later) even if I don't agree, if it's possible to not have regressions (apart maybe the "move to another page with space"), feel free to move forward (I won't be around in the next few days).

Ping ? What is the status ?:)

Ping ? What is the status ?:)

I'll be happy if someone else takes over. I'm still a bit hung up on other stuff. Don't expect much from me on this before christmas.
/Sune