Unhandled key events are sent to parent of QWebEngineView.
Hack with event filter on RenderWidgetHostViewQtDelegateWidget no longer
works for key events, so we need to install event filter on view
parent and handle key events there.
Downside is, that we can now only handle events that are not handled by
page itself.
* Add initial printing support with QtWebEngine >= 5.7.0
This works by printing to PDF first, then sending the PDF to a printer
if printing to a physical printer was requested.
On *nix (including Mac OS X), we use the lpr command, which is typically
provided by CUPS nowadays. Currently, no options beyond the printer name
are passed, there is room for improvement there. (Okular has a
FilePrinter class that handles this in a more sophisticated way.)
On Windows, we use ShellExecuteW with the "printto" verb. In that case,
the printer name is unfortunately the only thing that can be passed. The
user experience may also be suboptimal depending on the PDF viewer
installed on the system. (E.g., Adobe Reader is reported to ignore
SW_HIDE.) And if there is no PDF viewer installed at all, it will of
course not work at all. But it is the best we can do without bundling
something like GhostScript (or requiring the user to install it).
* Printing: Let lpr autoremove the temporary file instead of QTemporaryFile
Only lpr knows for sure when it is safe to delete the temporary file.
* Printing: Use the callback version of printToPdf instead of the file one
The file version is also asynchronous and does not report when it is
done.
* Printing: Use async QProcess API instead of QProcess::execute to run lpr
This also required making tempFile a QTemporaryFile * instead of a
QTemporaryFile on the stack, because QTemporaryFile is a QObject and
cannot be copied.
* Printing: Adapt the FilePrinter from Okular to pass correct lpr args
The license of those files is GPLv2+, which is compatible with
QupZilla's GPLv3+ licensing.
* WIN: Add CR to detection
Saving in Notepad++ with Windows line ending prevents script injection
Post fix for #1964 and some vague references at ce67c7a455
* Add some more line ending checks
* Windows ends in CR and OS Ⅸ compatible uses CR+LF ... OS Ⅹ/*nix uses LF
* Fix pre-existing bug with `\n' with string split for Windows ... tested only on Linux *(Qt 5.6.1)* with Unit Tests so far
Applies to #2027 and post followup for #1964
* Use default Left-associative for pipe (logical or)
* Specific first then general after e.g. flip them ... helps avoid a false injection match with a control character at the beginning with older editors *(may include OS2)*
Applies to #2027 and post followup for #1964