1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtwebengine-changes-qt6.html
\title Changes to Qt WebEngine
\ingroup changes-qt-5-to-6
\brief Migrate Qt WebEngine to Qt 6.
Qt 6 is a result of the conscious effort to make the framework more
efficient and easy to use.
We try to maintain binary and source compatibility for all the public
APIs in each release. But some changes were inevitable in an effort to
make Qt a better framework
In this topic we summarize those changes in Qt WebEngine, and provide guidance
to handle them.
\section1 Moved Classes
\section2 The Qt WebEngine module
Has been renamed to the Qt WebEngineQuick module to not collide with the name of
the super module, and to be consistent with other Quick modules.
If you port your Qt Quick application, please remember to use the new module
name in your qmake project file.
\code
QT += webenginequick
\endcode
\section2 Classes moved from Qt WebEngineWidgets to Qt WebEngineCore
Several classes have been moved from Qt WebEngineWidgets to Qt WebEngineCore if they
did not use the Widgets module. In most cases this change should be source compatible unless
you included the module name in the include header, in which case you need to update your
includes.
\section3 Classes moved with minimal changes
\list
\li QWebEngineHistory
\li QWebEngineProfile
\li QWebEngineScript
\li QWebEngineScriptCollection
\li QWebEngineClientCertificateSelection
\li QWebEngineSettings
\li QWebEngineFullScreenRequest
\endlist
\section3 QWebEngineCertificateError
Has been unified between QML and C++ versions, so both are now accepted or rejected via methods
on the class.
\section3 QWebEngineContextMenuData
Has been moved to Core and renamed QWebEngineContextMenuRequest.
\section3 QWebEngineDownloadItem
Has been moved to Core and renamed QWebEngineDownloadRequest.
\section3 QWebEnginePage
Has been moved to Core, and API that worked on QWebEngineView or QPrinter has been moved, and can now
be accessed only from QWebEngineView. See Changed API.
\section2 Classes moved from Qt WebEngineQuick to Qt WebEngineCore
\section3 WebEngineNavigationRequest
Is now QWebEngineNavigationRequest, and accessible from C++ API as well, adding a more
informative variant of QWebEnginePage::acceptNavigationRequest().
\section3 WebEngineNewViewRequest
Is now WebEngineNewWindowRequest and QWebEngineNewWindowRequest, and accessible from C++ API as well,
adding a more informative variant of QWebEnginePage::createWindow().
\section1 Changed API
\section2 C++
\section3 QWebEnginePage::certificateError()
Is now a signal instead of a derived method. The errors are either accepted or rejected
via methods on the QWebEngineCertificateError class.
\section3 QWebEnginePage::print()
Has been moved to QWebEngineView::print() and no longer takes a callback argument but
signals finished with QWebEngineView::printFinished() instead. It was never possible
to have two active print jobs at the same time.
\section3 QWebEnginePage::view()
Has been removed as QWebEnginePage and QWebEngineView are now in different modules. The view
associated with a page can be accessed using the static helper QWebEngineView::forPage().
\section3 QWebEngineProfile::defaultProfile()
Has been removed. The default profile is now an off-the-record profile, and only used if a
QWebEnginePage is created without an explicit profile. To maintain Qt 5 like behavior, create
a global profile called "Default" and use it when creating every QWebEnginePage.
\section2 QML
\section3 WebEngineNavigationRequest
The navigation requests are now accepted or rejected like other request objects using accept()
or reject() methods.
\section3 WebEngineNewViewRequest
Has been renamed WebEngineNewWindowRequest.
\section1 Changed Behavior
\section2 Default Profile
The default profile is now \e{off the record}. To have a standard browser profile with
disk-cache and cookies, we recommend creating your own profile and using that explicitly.
\section2 QRC Scheme
Can no longer be accessed from custom schemes by default, nor can it access local content
directly. If the Qt 5 behavior is needed, it can be restored by registering the qrc scheme
like a custom URL scheme, and setting the CorsEnabled and LocalAccessAllowed access flags.
\code
QWebEngineUrlScheme qrcScheme(QByteArrayLiteral("qrc"));
qrcScheme.setFlags(QWebEngineUrlScheme::SecureScheme
| QWebEngineUrlScheme::LocalAccessAllowed
| QWebEngineUrlScheme::CorsEnabled
| QWebEngineUrlScheme::ViewSourceAllowed);
QWebEngineUrlScheme::registerScheme(qrcScheme);
\endcode
\section2 OCSP Certificate Revocation Checking
In Qt 5 OCSP could be enabled on Linux using QWebEngineProfile::setUseForGlobalCertificateVerification(true)
on a QWebEngineProfile. This has been removed in Qt6 as this specific form of OCSP is considered bad. As
of Qt 6.2, no new method for revoked certificate checking on Linux has yet been added.
*/
|